--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Mon Oct 18 15:01:41 2010 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp Sat Oct 16 17:12:19 2010 -0400
@@ -377,10 +377,26 @@
}
// </PREDICTION>
-void HeapRegion::set_startsHumongous() {
+void HeapRegion::set_startsHumongous(HeapWord* new_end) {
+ assert(end() == _orig_end,
+ "Should be normal before the humongous object allocation");
+ assert(top() == bottom(), "should be empty");
+
_humongous_type = StartsHumongous;
_humongous_start_region = this;
- assert(end() == _orig_end, "Should be normal before alloc.");
+
+ set_end(new_end);
+ _offsets.set_for_starts_humongous(new_end);
+}
+
+void HeapRegion::set_continuesHumongous(HeapRegion* start) {
+ assert(end() == _orig_end,
+ "Should be normal before the humongous object allocation");
+ assert(top() == bottom(), "should be empty");
+ assert(start->startsHumongous(), "pre-condition");
+
+ _humongous_type = ContinuesHumongous;
+ _humongous_start_region = start;
}
bool HeapRegion::claimHeapRegion(jint claimValue) {
@@ -500,23 +516,6 @@
return blk.result();
}
-void HeapRegion::set_continuesHumongous(HeapRegion* start) {
- // The order is important here.
- start->add_continuingHumongousRegion(this);
- _humongous_type = ContinuesHumongous;
- _humongous_start_region = start;
-}
-
-void HeapRegion::add_continuingHumongousRegion(HeapRegion* cont) {
- // Must join the blocks of the current H region seq with the block of the
- // added region.
- offsets()->join_blocks(bottom(), cont->bottom());
- arrayOop obj = (arrayOop)(bottom());
- obj->set_length((int) (obj->length() + cont->capacity()/jintSize));
- set_end(cont->end());
- set_top(cont->end());
-}
-
void HeapRegion::save_marks() {
set_saved_mark();
}