src/share/vm/memory/heap.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/memory/heap.hpp	Fri Oct 11 15:44:37 2013
--- new/src/share/vm/memory/heap.hpp	Fri Oct 11 15:44:37 2013

*** 23,32 **** --- 23,33 ---- */ #ifndef SHARE_VM_MEMORY_HEAP_HPP #define SHARE_VM_MEMORY_HEAP_HPP + #include "code/codeBlob.hpp" #include "memory/allocation.hpp" #include "runtime/virtualspace.hpp" // Blocks
*** 90,99 **** --- 91,105 ---- size_t _next_segment; FreeBlock* _freelist; size_t _freelist_segments; // No. of segments in freelist + size_t _max_allocated_capacity; // Peak capacity that was allocated during lifetime of the heap + + const char* _name; // Name of the CodeHeap + const int _code_blob_type; // CodeBlobType it contains + bool _was_full; // True if CodeHeap was full during runtime // Helper functions size_t size_to_segments(size_t size) const { return (size + _segment_size - 1) >> _log2_segment_size; } size_t segments_to_size(size_t number_of_segments) const { return number_of_segments << _log2_segment_size; }
*** 120,133 **** --- 126,139 ---- // to perform additional actions on creation of executable code void on_code_mapping(char* base, size_t size); public: ! CodeHeap(const char* name, const int code_blob_type); // Heap extents ! bool reserve(size_t reserved_size, size_t committed_size, size_t segment_size); ! bool reserve(ReservedSpace rs, size_t committed_size, size_t segment_size); void release(); // releases all allocated memory bool expand_by(size_t size); // expands commited memory by size void shrink_by(size_t size); // shrinks commited memory by size void clear(); // clears all heap contents
*** 155,166 **** --- 161,181 ---- // Statistics size_t capacity() const; size_t max_capacity() const; size_t allocated_capacity() const; + size_t max_allocated_capacity() const { return _max_allocated_capacity; } size_t unallocated_capacity() const { return max_capacity() - allocated_capacity(); } + // Returns true if the CodeHeap contains CodeBlobs of the given type + bool accepts(int code_blob_type) const { return (_code_blob_type == code_blob_type); } + + // Debugging / Profiling + const char* name() const { return _name; } + bool was_full() { return _was_full; } + void report_full() { _was_full = true; } + private: size_t heap_unallocated_capacity() const; public: // Debugging

src/share/vm/memory/heap.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File