--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp Tue Mar 29 22:36:16 2011 -0400
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp Wed Mar 30 10:26:59 2011 -0400
@@ -38,15 +38,8 @@
// this is used for larger LAB allocations only.
inline HeapWord* G1OffsetTableContigSpace::par_allocate(size_t size) {
MutexLocker x(&_par_alloc_lock);
- // This ought to be just "allocate", because of the lock above, but that
- // ContiguousSpace::allocate asserts that either the allocating thread
- // holds the heap lock or it is the VM thread and we're at a safepoint.
- // The best I (dld) could figure was to put a field in ContiguousSpace
- // meaning "locking at safepoint taken care of", and set/reset that
- // here. But this will do for now, especially in light of the comment
- // above. Perhaps in the future some lock-free manner of keeping the
- // coordination.
- HeapWord* res = ContiguousSpace::par_allocate(size);
+ // Given that we take the lock no need to use par_allocate() here.
+ HeapWord* res = ContiguousSpace::allocate(size);
if (res != NULL) {
_offsets.alloc_block(res, size);
}