120 121 // Reason for current garbage collection. Should be set to 122 // a value reflecting no collection between collections. 123 GCCause::Cause _gc_cause; 124 GCCause::Cause _gc_lastcause; 125 PerfStringVariable* _perf_gc_cause; 126 PerfStringVariable* _perf_gc_lastcause; 127 128 // Constructor 129 CollectedHeap(); 130 131 // Create a new tlab. All TLAB allocations must go through this. 132 // To allow more flexible TLAB allocations min_size specifies 133 // the minimum size needed, while requested_size is the requested 134 // size based on ergonomics. The actually allocated size will be 135 // returned in actual_size. 136 virtual HeapWord* allocate_new_tlab(size_t min_size, 137 size_t requested_size, 138 size_t* actual_size); 139 140 // Accumulate statistics on all tlabs. 141 virtual void accumulate_statistics_all_tlabs(); 142 143 // Reinitialize tlabs before resuming mutators. 144 virtual void resize_all_tlabs(); 145 146 // Raw memory allocation facilities 147 // The obj and array allocate methods are covers for these methods. 148 // mem_allocate() should never be 149 // called to allocate TLABs, only individual objects. 150 virtual HeapWord* mem_allocate(size_t size, 151 bool* gc_overhead_limit_was_exceeded) = 0; 152 153 // Filler object utilities. 154 static inline size_t filler_array_hdr_size(); 155 static inline size_t filler_array_min_size(); 156 157 DEBUG_ONLY(static void fill_args_check(HeapWord* start, size_t words);) 158 DEBUG_ONLY(static void zap_filler_array(HeapWord* start, size_t words, bool zap = true);) 159 160 // Fill with a single array; caller must ensure filler_array_min_size() <= 161 // words <= filler_array_max_size(). 162 static inline void fill_with_array(HeapWord* start, size_t words, bool zap = true); | 120 121 // Reason for current garbage collection. Should be set to 122 // a value reflecting no collection between collections. 123 GCCause::Cause _gc_cause; 124 GCCause::Cause _gc_lastcause; 125 PerfStringVariable* _perf_gc_cause; 126 PerfStringVariable* _perf_gc_lastcause; 127 128 // Constructor 129 CollectedHeap(); 130 131 // Create a new tlab. All TLAB allocations must go through this. 132 // To allow more flexible TLAB allocations min_size specifies 133 // the minimum size needed, while requested_size is the requested 134 // size based on ergonomics. The actually allocated size will be 135 // returned in actual_size. 136 virtual HeapWord* allocate_new_tlab(size_t min_size, 137 size_t requested_size, 138 size_t* actual_size); 139 140 // Reinitialize tlabs before resuming mutators. 141 virtual void resize_all_tlabs(); 142 143 // Raw memory allocation facilities 144 // The obj and array allocate methods are covers for these methods. 145 // mem_allocate() should never be 146 // called to allocate TLABs, only individual objects. 147 virtual HeapWord* mem_allocate(size_t size, 148 bool* gc_overhead_limit_was_exceeded) = 0; 149 150 // Filler object utilities. 151 static inline size_t filler_array_hdr_size(); 152 static inline size_t filler_array_min_size(); 153 154 DEBUG_ONLY(static void fill_args_check(HeapWord* start, size_t words);) 155 DEBUG_ONLY(static void zap_filler_array(HeapWord* start, size_t words, bool zap = true);) 156 157 // Fill with a single array; caller must ensure filler_array_min_size() <= 158 // words <= filler_array_max_size(). 159 static inline void fill_with_array(HeapWord* start, size_t words, bool zap = true); |