Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 20295:3f2894c5052e
8048112: G1 Full GC needs to support the case when the very first region is not available
Summary: Refactor preparation for compaction during Full GC so that it lazily initializes the first compaction point. This also avoids problems later when the first region may not be committed. Also reviewed by K. Barrett.
Reviewed-by: brutisso
author | tschatzl |
---|---|
date | Mon, 21 Jul 2014 10:00:31 +0200 |
parents | e0954897238a |
children | a3953c777565 |
comparison
equal
deleted
inserted
replaced
20294:dd219eaec9cc | 20295:3f2894c5052e |
---|---|
2969 } | 2969 } |
2970 cur = next; | 2970 cur = next; |
2971 } | 2971 } |
2972 } | 2972 } |
2973 | 2973 |
2974 CompactibleSpace* G1CollectedHeap::first_compactible_space() { | 2974 HeapRegion* G1CollectedHeap::next_compaction_region(const HeapRegion* from) const { |
2975 return n_regions() > 0 ? region_at(0) : NULL; | 2975 // We're not using an iterator given that it will wrap around when |
2976 } | 2976 // it reaches the last region and this is not what we want here. |
2977 | 2977 for (uint index = from->hrs_index() + 1; index < n_regions(); index++) { |
2978 HeapRegion* hr = region_at(index); | |
2979 if (!hr->isHumongous()) { | |
2980 return hr; | |
2981 } | |
2982 } | |
2983 return NULL; | |
2984 } | |
2978 | 2985 |
2979 Space* G1CollectedHeap::space_containing(const void* addr) const { | 2986 Space* G1CollectedHeap::space_containing(const void* addr) const { |
2980 Space* res = heap_region_containing(addr); | 2987 Space* res = heap_region_containing(addr); |
2981 return res; | 2988 return res; |
2982 } | 2989 } |