139 |
139 |
140 // Reinitialize tlabs before resuming mutators. |
140 // Reinitialize tlabs before resuming mutators. |
141 virtual void resize_all_tlabs(); |
141 virtual void resize_all_tlabs(); |
142 |
142 |
143 // Allocate from the current thread's TLAB, with broken-out slow path. |
143 // Allocate from the current thread's TLAB, with broken-out slow path. |
144 inline static HeapWord* allocate_from_tlab(Klass* klass, Thread* thread, size_t size); |
144 inline static HeapWord* allocate_from_tlab(Klass* klass, size_t size, TRAPS); |
145 static HeapWord* allocate_from_tlab_slow(Klass* klass, Thread* thread, size_t size); |
145 static HeapWord* allocate_from_tlab_slow(Klass* klass, size_t size, TRAPS); |
|
146 |
|
147 // Raw memory allocation facilities |
|
148 // The obj and array allocate methods are covers for these methods. |
|
149 // mem_allocate() should never be |
|
150 // called to allocate TLABs, only individual objects. |
|
151 virtual HeapWord* mem_allocate(size_t size, |
|
152 bool* gc_overhead_limit_was_exceeded) = 0; |
146 |
153 |
147 // Allocate an uninitialized block of the given size, or returns NULL if |
154 // Allocate an uninitialized block of the given size, or returns NULL if |
148 // this is impossible. |
155 // this is impossible. |
149 inline static HeapWord* common_mem_allocate_noinit(Klass* klass, size_t size, TRAPS); |
156 inline static HeapWord* common_mem_allocate_noinit(Klass* klass, size_t size, TRAPS); |
150 |
157 |
307 inline static oop obj_allocate(Klass* klass, int size, TRAPS); |
314 inline static oop obj_allocate(Klass* klass, int size, TRAPS); |
308 inline static oop array_allocate(Klass* klass, int size, int length, TRAPS); |
315 inline static oop array_allocate(Klass* klass, int size, int length, TRAPS); |
309 inline static oop array_allocate_nozero(Klass* klass, int size, int length, TRAPS); |
316 inline static oop array_allocate_nozero(Klass* klass, int size, int length, TRAPS); |
310 inline static oop class_allocate(Klass* klass, int size, TRAPS); |
317 inline static oop class_allocate(Klass* klass, int size, TRAPS); |
311 |
318 |
312 // Raw memory allocation facilities |
319 // Raw memory allocation. This may or may not use TLAB allocations to satisfy the |
313 // The obj and array allocate methods are covers for these methods. |
320 // allocation. A GC implementation may override this function to satisfy the allocation |
314 // mem_allocate() should never be |
321 // in any way. But the default is to try a TLAB allocation, and otherwise perform |
315 // called to allocate TLABs, only individual objects. |
322 // mem_allocate. |
316 virtual HeapWord* mem_allocate(size_t size, |
323 virtual HeapWord* obj_allocate_raw(Klass* klass, size_t size, |
317 bool* gc_overhead_limit_was_exceeded) = 0; |
324 bool* gc_overhead_limit_was_exceeded, TRAPS); |
318 |
325 |
319 // Utilities for turning raw memory into filler objects. |
326 // Utilities for turning raw memory into filler objects. |
320 // |
327 // |
321 // min_fill_size() is the smallest region that can be filled. |
328 // min_fill_size() is the smallest region that can be filled. |
322 // fill_with_objects() can fill arbitrary-sized regions of the heap using |
329 // fill_with_objects() can fill arbitrary-sized regions of the heap using |