8061449: G1: FreeRegionList_test() fails with G1 after the JDK-8058534 fix to HeapRegion::orig_end()
authorbrutisso
Wed, 05 Nov 2014 10:12:51 +0100
changeset 27629 81ea316b7244
parent 27628 b655b90d98f4
child 27630 f5b2d7c500f4
8061449: G1: FreeRegionList_test() fails with G1 after the JDK-8058534 fix to HeapRegion::orig_end() Reviewed-by: mgerdin, tschatzl, stefank
hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp	Mon Nov 03 15:53:48 2014 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.cpp	Wed Nov 05 10:12:51 2014 +0100
@@ -426,11 +426,19 @@
                                          mtGC);
   G1BlockOffsetSharedArray oa(heap, bot_storage);
   bot_storage->commit_regions(0, num_regions_in_test);
-  HeapRegion hr0(0, &oa, heap);
-  HeapRegion hr1(1, &oa, heap);
-  HeapRegion hr2(2, &oa, heap);
-  HeapRegion hr3(3, &oa, heap);
-  HeapRegion hr4(4, &oa, heap);
+
+  // Set up memory regions for the heap regions.
+  MemRegion mr0(heap.start(), HeapRegion::GrainWords);
+  MemRegion mr1(mr0.end(), HeapRegion::GrainWords);
+  MemRegion mr2(mr1.end(), HeapRegion::GrainWords);
+  MemRegion mr3(mr2.end(), HeapRegion::GrainWords);
+  MemRegion mr4(mr3.end(), HeapRegion::GrainWords);
+
+  HeapRegion hr0(0, &oa, mr0);
+  HeapRegion hr1(1, &oa, mr1);
+  HeapRegion hr2(2, &oa, mr2);
+  HeapRegion hr3(3, &oa, mr3);
+  HeapRegion hr4(4, &oa, mr4);
   l.add_ordered(&hr1);
   l.add_ordered(&hr0);
   l.add_ordered(&hr3);