< prev index next >

src/hotspot/share/gc/cms/parNewGeneration.cpp

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

*** 1,7 **** /* ! * Copyright (c) 2001, 2017, 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.
*** 1131,1141 **** // The sequential code read "old->age()" below. That doesn't work here, // since the age is in the mark word, and that might be overwritten with // a forwarding pointer by a parallel thread. So we must save the mark // word in a local and then analyze it. oopDesc dummyOld; ! dummyOld.set_mark(m); assert(!dummyOld.is_forwarded(), "should not be called with forwarding pointer mark word."); oop new_obj = NULL; oop forward_ptr; --- 1131,1141 ---- // The sequential code read "old->age()" below. That doesn't work here, // since the age is in the mark word, and that might be overwritten with // a forwarding pointer by a parallel thread. So we must save the mark // word in a local and then analyze it. oopDesc dummyOld; ! dummyOld.set_mark_raw(m); assert(!dummyOld.is_forwarded(), "should not be called with forwarding pointer mark word."); oop new_obj = NULL; oop forward_ptr;
*** 1179,1189 **** // Is in to-space; do copying ourselves. Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz); assert(CMSHeap::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value."); forward_ptr = old->forward_to_atomic(new_obj); // Restore the mark word copied above. ! new_obj->set_mark(m); // Increment age if obj still in new generation new_obj->incr_age(); par_scan_state->age_table()->add(new_obj, sz); } assert(new_obj != NULL, "just checking"); --- 1179,1189 ---- // Is in to-space; do copying ourselves. Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)new_obj, sz); assert(CMSHeap::heap()->is_in_reserved(new_obj), "illegal forwarding pointer value."); forward_ptr = old->forward_to_atomic(new_obj); // Restore the mark word copied above. ! new_obj->set_mark_raw(m); // Increment age if obj still in new generation new_obj->incr_age(); par_scan_state->age_table()->add(new_obj, sz); } assert(new_obj != NULL, "just checking");
< prev index next >