Mercurial > hg > truffle
comparison src/share/vm/memory/space.cpp @ 20276:1526a938e670
8047818: G1 HeapRegions can no longer be ContiguousSpaces
Summary: Change parent of G1OffsetTableContigSpace to CompactibleSpace, reimplement missing functionality
Reviewed-by: stefank, jmasa, tschatzl
author | mgerdin |
---|---|
date | Thu, 26 Jun 2014 11:36:58 +0200 |
parents | ff1e37e7eb83 |
children | ee019285a52c |
comparison
equal
deleted
inserted
replaced
20275:e5035defa3c4 | 20276:1526a938e670 |
---|---|
682 } | 682 } |
683 | 683 |
684 // This version requires locking. | 684 // This version requires locking. |
685 inline HeapWord* ContiguousSpace::allocate_impl(size_t size, | 685 inline HeapWord* ContiguousSpace::allocate_impl(size_t size, |
686 HeapWord* const end_value) { | 686 HeapWord* const end_value) { |
687 // In G1 there are places where a GC worker can allocates into a | |
688 // region using this serial allocation code without being prone to a | |
689 // race with other GC workers (we ensure that no other GC worker can | |
690 // access the same region at the same time). So the assert below is | |
691 // too strong in the case of G1. | |
692 assert(Heap_lock->owned_by_self() || | 687 assert(Heap_lock->owned_by_self() || |
693 (SafepointSynchronize::is_at_safepoint() && | 688 (SafepointSynchronize::is_at_safepoint() && Thread::current()->is_VM_thread()), |
694 (Thread::current()->is_VM_thread() || UseG1GC)), | |
695 "not locked"); | 689 "not locked"); |
696 HeapWord* obj = top(); | 690 HeapWord* obj = top(); |
697 if (pointer_delta(end_value, obj) >= size) { | 691 if (pointer_delta(end_value, obj) >= size) { |
698 HeapWord* new_top = obj + size; | 692 HeapWord* new_top = obj + size; |
699 set_top(new_top); | 693 set_top(new_top); |