--- old/src/share/vm/gc/shared/space.inline.hpp 2015-10-14 13:54:06.008088009 +0200 +++ new/src/share/vm/gc/shared/space.inline.hpp 2015-10-14 13:54:05.903090548 +0200 @@ -121,14 +121,16 @@ while (q < t) { assert(!space->scanned_block_is_obj(q) || - oop(q)->mark()->is_marked() || oop(q)->mark()->is_unlocked() || - oop(q)->mark()->has_bias_pattern(), + space->make_oop(q)->mark()->is_marked() || + space->make_oop(q)->mark()->is_unlocked() || + space->make_oop(q)->mark()->has_bias_pattern() || + oopDesc::bs()->read_barrier(space->make_oop(q)) != space->make_oop(q), "these are the only valid states during a mark sweep"); - if (space->scanned_block_is_obj(q) && oop(q)->is_gc_marked()) { + if (space->scanned_block_is_obj(q) && space->make_oop(q)->is_gc_marked()) { // prefetch beyond q Prefetch::write(q, interval); size_t size = space->scanned_block_size(q); - compact_top = cp->space->forward(oop(q), size, cp, compact_top); + compact_top = cp->space->forward(space->make_oop(q), size, cp, compact_top); q += size; end_of_live = q; } else { @@ -138,14 +140,14 @@ // prefetch beyond end Prefetch::write(end, interval); end += space->scanned_block_size(end); - } while (end < t && (!space->scanned_block_is_obj(end) || !oop(end)->is_gc_marked())); + } while (end < t && (!space->scanned_block_is_obj(end) || !space->make_oop(end)->is_gc_marked())); // see if we might want to pretend this object is alive so that // we don't have to compact quite as often. if (allowed_deadspace > 0 && q == compact_top) { size_t sz = pointer_delta(end, q); if (space->insert_deadspace(allowed_deadspace, q, sz)) { - compact_top = cp->space->forward(oop(q), sz, cp, compact_top); + compact_top = cp->space->forward(space->make_oop(q), sz, cp, compact_top); q = end; end_of_live = end; continue; @@ -161,7 +163,7 @@ // record the current LiveRange object. // liveRange->start() is overlaid on the mark word. - liveRange = (LiveRange*)q; + liveRange = (LiveRange*) (HeapWord*) space->make_oop(q); liveRange->set_start(end); liveRange->set_end(end); @@ -199,7 +201,7 @@ assert(space->_first_dead <= space->_end_of_live, "Stands to reason, no?"); - if (q < t && space->_first_dead > q && !oop(q)->is_gc_marked()) { + if (q < t && space->_first_dead > q && !space->make_oop(q)->is_gc_marked()) { // we have a chunk of the space which hasn't moved and we've // reinitialized the mark word during the previous pass, so we can't // use is_gc_marked for the traversal. @@ -214,7 +216,7 @@ assert(space->block_is_obj(q), "should be at block boundaries, and should be looking at objs"); // point all the oops to the new location - size_t size = MarkSweep::adjust_pointers(oop(q)); + size_t size = MarkSweep::adjust_pointers(space->make_oop(q)); size = space->adjust_obj_size(size); q += size; @@ -235,10 +237,10 @@ while (q < t) { // prefetch beyond q Prefetch::write(q, interval); - if (oop(q)->is_gc_marked()) { + if (space->make_oop(q)->is_gc_marked()) { // q is alive // point all the oops to the new location - size_t size = MarkSweep::adjust_pointers(oop(q)); + size_t size = MarkSweep::adjust_pointers(space->make_oop(q)); size = space->adjust_obj_size(size); debug_only(prev_q = q); q += size; @@ -246,7 +248,7 @@ // q is not a live object, so its mark should point at the next // live object debug_only(prev_q = q); - q = (HeapWord*) oop(q)->mark()->decode_pointer(); + q = (HeapWord*) space->make_oop(q)->mark()->decode_pointer(); assert(q > prev_q, "we should be moving forward through memory"); } } @@ -263,7 +265,7 @@ HeapWord* const t = space->_end_of_live; debug_only(HeapWord* prev_q = NULL); - if (q < t && space->_first_dead > q && !oop(q)->is_gc_marked()) { + if (q < t && space->_first_dead > q && !space->make_oop(q)->is_gc_marked()) { #ifdef ASSERT // Debug only // we have a chunk of the space which hasn't moved and we've reinitialized // the mark word during the previous pass, so we can't use is_gc_marked for @@ -272,7 +274,7 @@ while (q < end) { size_t size = space->obj_size(q); - assert(!oop(q)->is_gc_marked(), "should be unmarked (special dense prefix handling)"); + assert(!space->make_oop(q)->is_gc_marked(), "should be unmarked (special dense prefix handling)"); prev_q = q; q += size; } @@ -289,10 +291,10 @@ const intx scan_interval = PrefetchScanIntervalInBytes; const intx copy_interval = PrefetchCopyIntervalInBytes; while (q < t) { - if (!oop(q)->is_gc_marked()) { + if (!space->make_oop(q)->is_gc_marked()) { // mark is pointer to next marked oop debug_only(prev_q = q); - q = (HeapWord*) oop(q)->mark()->decode_pointer(); + q = (HeapWord*) space->make_oop(q)->mark()->decode_pointer(); assert(q > prev_q, "we should be moving forward through memory"); } else { // prefetch beyond q @@ -300,14 +302,14 @@ // size and destination size_t size = space->obj_size(q); - HeapWord* compaction_top = (HeapWord*)oop(q)->forwardee(); + HeapWord* compaction_top = (HeapWord*)space->make_oop(q)->forwardee(); // prefetch beyond compaction_top Prefetch::write(compaction_top, copy_interval); // copy object and reinit its mark assert(q != compaction_top, "everything in this pass should be moving"); - Copy::aligned_conjoint_words(q, compaction_top, size); + Copy::aligned_conjoint_words((HeapWord*) space->make_oop(q), compaction_top, size); oop(compaction_top)->init_mark(); assert(oop(compaction_top)->klass() != NULL, "should have a class");