< prev index next >

src/share/vm/gc/shared/space.inline.hpp

Print this page

        

*** 119,153 **** const intx interval = PrefetchScanIntervalInBytes; 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(), "these are the only valid states during a mark sweep"); ! if (space->scanned_block_is_obj(q) && 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); q += size; end_of_live = q; } else { // run over all the contiguous dead objects HeapWord* end = q; do { // 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())); // 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); q = end; end_of_live = end; continue; } } --- 119,155 ---- const intx interval = PrefetchScanIntervalInBytes; while (q < t) { assert(!space->scanned_block_is_obj(q) || ! 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) && 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(space->make_oop(q), size, cp, compact_top); q += size; end_of_live = q; } else { // run over all the contiguous dead objects HeapWord* end = q; do { // prefetch beyond end Prefetch::write(end, interval); end += space->scanned_block_size(end); ! } 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(space->make_oop(q), sz, cp, compact_top); q = end; end_of_live = end; continue; } }
*** 159,169 **** liveRange->set_end(q); } // record the current LiveRange object. // liveRange->start() is overlaid on the mark word. ! liveRange = (LiveRange*)q; liveRange->set_start(end); liveRange->set_end(end); // see if this is the first dead region. if (q < first_dead) { --- 161,171 ---- liveRange->set_end(q); } // record the current LiveRange object. // liveRange->start() is overlaid on the mark word. ! liveRange = (LiveRange*) (HeapWord*) space->make_oop(q); liveRange->set_start(end); liveRange->set_end(end); // see if this is the first dead region. if (q < first_dead) {
*** 197,207 **** HeapWord* q = space->bottom(); HeapWord* t = space->_end_of_live; // Established by "prepare_for_compaction". assert(space->_first_dead <= space->_end_of_live, "Stands to reason, no?"); ! if (q < t && space->_first_dead > q && !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. HeapWord* end = space->_first_dead; --- 199,209 ---- HeapWord* q = space->bottom(); HeapWord* t = space->_end_of_live; // Established by "prepare_for_compaction". assert(space->_first_dead <= space->_end_of_live, "Stands to reason, no?"); ! 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. HeapWord* end = space->_first_dead;
*** 212,222 **** // after their pointers have been // updated, until the actual compaction is done. dld, 4/00 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 = space->adjust_obj_size(size); q += size; } --- 214,224 ---- // after their pointers have been // updated, until the actual compaction is done. dld, 4/00 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(space->make_oop(q)); size = space->adjust_obj_size(size); q += size; }
*** 233,254 **** debug_only(HeapWord* prev_q = NULL); while (q < t) { // prefetch beyond q Prefetch::write(q, interval); ! if (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 = space->adjust_obj_size(size); debug_only(prev_q = q); q += size; } else { // 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(); assert(q > prev_q, "we should be moving forward through memory"); } } assert(q == t, "just checking"); --- 235,256 ---- debug_only(HeapWord* prev_q = NULL); while (q < t) { // prefetch beyond q Prefetch::write(q, interval); ! 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(space->make_oop(q)); size = space->adjust_obj_size(size); debug_only(prev_q = q); q += size; } else { // q is not a live object, so its mark should point at the next // live object debug_only(prev_q = q); ! q = (HeapWord*) space->make_oop(q)->mark()->decode_pointer(); assert(q > prev_q, "we should be moving forward through memory"); } } assert(q == t, "just checking");
*** 261,280 **** HeapWord* q = space->bottom(); 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()) { #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 // the traversal. HeapWord* const end = space->_first_dead; while (q < end) { size_t size = space->obj_size(q); ! assert(!oop(q)->is_gc_marked(), "should be unmarked (special dense prefix handling)"); prev_q = q; q += size; } #endif --- 263,282 ---- HeapWord* q = space->bottom(); HeapWord* const t = space->_end_of_live; debug_only(HeapWord* prev_q = NULL); ! 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 // the traversal. HeapWord* const end = space->_first_dead; while (q < end) { size_t size = space->obj_size(q); ! assert(!space->make_oop(q)->is_gc_marked(), "should be unmarked (special dense prefix handling)"); prev_q = q; q += size; } #endif
*** 287,315 **** } const intx scan_interval = PrefetchScanIntervalInBytes; const intx copy_interval = PrefetchCopyIntervalInBytes; while (q < t) { ! if (!oop(q)->is_gc_marked()) { // mark is pointer to next marked oop debug_only(prev_q = q); ! q = (HeapWord*) oop(q)->mark()->decode_pointer(); assert(q > prev_q, "we should be moving forward through memory"); } else { // prefetch beyond q Prefetch::read(q, scan_interval); // size and destination size_t size = space->obj_size(q); ! HeapWord* compaction_top = (HeapWord*)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); oop(compaction_top)->init_mark(); assert(oop(compaction_top)->klass() != NULL, "should have a class"); debug_only(prev_q = q); q += size; --- 289,317 ---- } const intx scan_interval = PrefetchScanIntervalInBytes; const intx copy_interval = PrefetchCopyIntervalInBytes; while (q < t) { ! if (!space->make_oop(q)->is_gc_marked()) { // mark is pointer to next marked oop debug_only(prev_q = q); ! q = (HeapWord*) space->make_oop(q)->mark()->decode_pointer(); assert(q > prev_q, "we should be moving forward through memory"); } else { // prefetch beyond q Prefetch::read(q, scan_interval); // size and destination size_t size = space->obj_size(q); ! 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((HeapWord*) space->make_oop(q), compaction_top, size); oop(compaction_top)->init_mark(); assert(oop(compaction_top)->klass() != NULL, "should have a class"); debug_only(prev_q = q); q += size;
< prev index next >