< prev index next >

src/hotspot/share/gc/parallel/psMarkSweepDecorator.cpp

Print this page
rev 49289 : 8199735: Mark word updates need to use Access API

*** 1,7 **** /* ! * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 110,121 **** HeapWord* first_dead = space()->end(); /* The first dead object. */ const intx interval = PrefetchScanIntervalInBytes; while (q < t) { ! assert(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 (oop(q)->is_gc_marked()) { /* prefetch beyond q */ Prefetch::write(q, interval); size_t size = oop(q)->size(); --- 110,121 ---- HeapWord* first_dead = space()->end(); /* The first dead object. */ const intx interval = PrefetchScanIntervalInBytes; while (q < t) { ! assert(oop(q)->mark_raw()->is_marked() || oop(q)->mark_raw()->is_unlocked() || ! oop(q)->mark_raw()->has_bias_pattern(), "these are the only valid states during a mark sweep"); if (oop(q)->is_gc_marked()) { /* prefetch beyond q */ Prefetch::write(q, interval); size_t size = oop(q)->size();
*** 148,158 **** oop(q)->forward_to(oop(compact_top)); assert(oop(q)->is_gc_marked(), "encoding the pointer should preserve the mark"); } else { // if the object isn't moving we can just set the mark to the default // mark and handle it specially later on. ! oop(q)->init_mark(); assert(oop(q)->forwardee() == NULL, "should be forwarded to NULL"); } // Update object start array if (start_array) { --- 148,158 ---- oop(q)->forward_to(oop(compact_top)); assert(oop(q)->is_gc_marked(), "encoding the pointer should preserve the mark"); } else { // if the object isn't moving we can just set the mark to the default // mark and handle it specially later on. ! oop(q)->init_mark_raw(); assert(oop(q)->forwardee() == NULL, "should be forwarded to NULL"); } // Update object start array if (start_array) {
*** 208,218 **** oop(q)->forward_to(oop(compact_top)); assert(oop(q)->is_gc_marked(), "encoding the pointer should preserve the mark"); } else { // if the object isn't moving we can just set the mark to the default // mark and handle it specially later on. ! oop(q)->init_mark(); assert(oop(q)->forwardee() == NULL, "should be forwarded to NULL"); } // Update object start array if (start_array) { --- 208,218 ---- oop(q)->forward_to(oop(compact_top)); assert(oop(q)->is_gc_marked(), "encoding the pointer should preserve the mark"); } else { // if the object isn't moving we can just set the mark to the default // mark and handle it specially later on. ! oop(q)->init_mark_raw(); assert(oop(q)->forwardee() == NULL, "should be forwarded to NULL"); } // Update object start array if (start_array) {
*** 256,266 **** bool PSMarkSweepDecorator::insert_deadspace(size_t& allowed_deadspace_words, HeapWord* q, size_t deadlength) { if (allowed_deadspace_words >= deadlength) { allowed_deadspace_words -= deadlength; CollectedHeap::fill_with_object(q, deadlength); ! oop(q)->set_mark(oop(q)->mark()->set_marked()); assert((int) deadlength == oop(q)->size(), "bad filler object size"); // Recall that we required "q == compaction_top". return true; } else { allowed_deadspace_words = 0; --- 256,266 ---- bool PSMarkSweepDecorator::insert_deadspace(size_t& allowed_deadspace_words, HeapWord* q, size_t deadlength) { if (allowed_deadspace_words >= deadlength) { allowed_deadspace_words -= deadlength; CollectedHeap::fill_with_object(q, deadlength); ! oop(q)->set_mark_raw(oop(q)->mark_raw()->set_marked()); assert((int) deadlength == oop(q)->size(), "bad filler object size"); // Recall that we required "q == compaction_top". return true; } else { allowed_deadspace_words = 0;
*** 347,368 **** if (_first_dead == t) { q = t; } else { // $$$ Funky ! q = (HeapWord*) oop(_first_dead)->mark()->decode_pointer(); } } 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); --- 347,368 ---- if (_first_dead == t) { q = t; } else { // $$$ Funky ! q = (HeapWord*) oop(_first_dead)->mark_raw()->decode_pointer(); } } 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_raw()->decode_pointer(); assert(q > prev_q, "we should be moving forward through memory"); } else { // prefetch beyond q Prefetch::read(q, scan_interval);
*** 374,384 **** 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; } --- 374,384 ---- 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_raw(); assert(oop(compaction_top)->klass() != NULL, "should have a class"); debug_only(prev_q = q); q += size; }
< prev index next >