8047818: G1 HeapRegions can no longer be ContiguousSpaces

Change parent of G1OffsetTableContigSpace to CompactibleSpace, reimplement missing functionality

Reviewed-by: stefank, jmasa, tschatzl
This commit is contained in:
Mikael Gerdin 2014-06-26 11:36:58 +02:00
parent ebdab477c7
commit 1e1ef4f73f
8 changed files with 179 additions and 49 deletions

View file

@ -685,14 +685,8 @@ size_t ContiguousSpace::block_size(const HeapWord* p) const {
// This version requires locking.
inline HeapWord* ContiguousSpace::allocate_impl(size_t size,
HeapWord* const end_value) {
// In G1 there are places where a GC worker can allocates into a
// region using this serial allocation code without being prone to a
// race with other GC workers (we ensure that no other GC worker can
// access the same region at the same time). So the assert below is
// too strong in the case of G1.
assert(Heap_lock->owned_by_self() ||
(SafepointSynchronize::is_at_safepoint() &&
(Thread::current()->is_VM_thread() || UseG1GC)),
(SafepointSynchronize::is_at_safepoint() && Thread::current()->is_VM_thread()),
"not locked");
HeapWord* obj = top();
if (pointer_delta(end_value, obj) >= size) {