1.1 --- a/src/share/vm/memory/space.cpp Tue Mar 29 22:36:16 2011 -0400 1.2 +++ b/src/share/vm/memory/space.cpp Wed Mar 30 10:26:59 2011 -0400 1.3 @@ -818,9 +818,14 @@ 1.4 // This version requires locking. 1.5 inline HeapWord* ContiguousSpace::allocate_impl(size_t size, 1.6 HeapWord* const end_value) { 1.7 + // In G1 there are places where a GC worker can allocates into a 1.8 + // region using this serial allocation code without being prone to a 1.9 + // race with other GC workers (we ensure that no other GC worker can 1.10 + // access the same region at the same time). So the assert below is 1.11 + // too strong in the case of G1. 1.12 assert(Heap_lock->owned_by_self() || 1.13 (SafepointSynchronize::is_at_safepoint() && 1.14 - Thread::current()->is_VM_thread()), 1.15 + (Thread::current()->is_VM_thread() || UseG1GC)), 1.16 "not locked"); 1.17 HeapWord* obj = top(); 1.18 if (pointer_delta(end_value, obj) >= size) {