Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 20304:a22acf6d7598
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 | f3aeae1f9fc5 |
children | 755930f931e3 |
comparison
equal
deleted
inserted
replaced
20303:c512f38a5139 | 20304:a22acf6d7598 |
---|---|
2955 } | 2955 } |
2956 cur = next; | 2956 cur = next; |
2957 } | 2957 } |
2958 } | 2958 } |
2959 | 2959 |
2960 CompactibleSpace* G1CollectedHeap::first_compactible_space() { | 2960 HeapRegion* G1CollectedHeap::next_compaction_region(const HeapRegion* from) const { |
2961 return n_regions() > 0 ? region_at(0) : NULL; | 2961 // We're not using an iterator given that it will wrap around when |
2962 } | 2962 // it reaches the last region and this is not what we want here. |
2963 | 2963 for (uint index = from->hrs_index() + 1; index < n_regions(); index++) { |
2964 HeapRegion* hr = region_at(index); | |
2965 if (!hr->isHumongous()) { | |
2966 return hr; | |
2967 } | |
2968 } | |
2969 return NULL; | |
2970 } | |
2964 | 2971 |
2965 Space* G1CollectedHeap::space_containing(const void* addr) const { | 2972 Space* G1CollectedHeap::space_containing(const void* addr) const { |
2966 Space* res = heap_region_containing(addr); | 2973 Space* res = heap_region_containing(addr); |
2967 return res; | 2974 return res; |
2968 } | 2975 } |