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 Sep 5 10:38:00 2014
--- new/src/share/vm/memory/heap.hpp Fri Sep 5 10:38:00 2014
*** 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
*** 91,100 ****
--- 92,106 ----
size_t _next_segment;
FreeBlock* _freelist;
size_t _freelist_segments; // No. of segments in freelist
int _freelist_length;
+ 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 the code heap was full
enum { free_sentinel = 0xFF };
// Helper functions
size_t size_to_segments(size_t size) const { return (size + _segment_size - 1) >> _log2_segment_size; }
*** 125,138 ****
--- 131,144 ----
// to perform additional actions on creation of executable code
void on_code_mapping(char* base, size_t size);
void clear(); // clears all heap contents
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);
bool expand_by(size_t size); // expands committed memory by size
// Memory allocation
void* allocate (size_t size, bool is_critical); // allocates a block of size or returns NULL
void deallocate(void* p); // deallocates a block
*** 159,170 ****
--- 165,186 ----
// Statistics
size_t capacity() const;
size_t max_capacity() const;
int allocated_segments() 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); }
+ int code_blob_type() const { return _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