< prev index next >
src/hotspot/share/gc/cms/parOopClosures.inline.hpp
Print this page
rev 49289 : 8199735: Mark word updates need to use Access API
*** 1,7 ****
/*
! * Copyright (c) 2007, 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) 2007, 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.
*** 30,50 ****
#include "gc/cms/parOopClosures.hpp"
#include "gc/shared/cardTableRS.hpp"
#include "gc/shared/genOopClosures.inline.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
template <class T> inline void ParScanWeakRefClosure::do_oop_work(T* p) {
assert (!oopDesc::is_null(*p), "null weak reference?");
oop obj = oopDesc::load_decode_heap_oop_not_null(p);
// weak references are sometimes scanned twice; must check
// that to-space doesn't already contain this object
if ((HeapWord*)obj < _boundary && !_g->to()->is_in_reserved(obj)) {
// we need to ensure that it is copied (see comment in
// ParScanClosure::do_oop_work).
Klass* objK = obj->klass();
! markOop m = obj->mark();
oop new_obj;
if (m->is_marked()) { // Contains forwarding pointer.
new_obj = ParNewGeneration::real_forwardee(obj);
} else {
size_t obj_sz = obj->size_given_klass(objK);
--- 30,51 ----
#include "gc/cms/parOopClosures.hpp"
#include "gc/shared/cardTableRS.hpp"
#include "gc/shared/genOopClosures.inline.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
+ #include "oops/oop.inline.hpp"
template <class T> inline void ParScanWeakRefClosure::do_oop_work(T* p) {
assert (!oopDesc::is_null(*p), "null weak reference?");
oop obj = oopDesc::load_decode_heap_oop_not_null(p);
// weak references are sometimes scanned twice; must check
// that to-space doesn't already contain this object
if ((HeapWord*)obj < _boundary && !_g->to()->is_in_reserved(obj)) {
// we need to ensure that it is copied (see comment in
// ParScanClosure::do_oop_work).
Klass* objK = obj->klass();
! markOop m = obj->mark_raw();
oop new_obj;
if (m->is_marked()) { // Contains forwarding pointer.
new_obj = ParNewGeneration::real_forwardee(obj);
} else {
size_t obj_sz = obj->size_given_klass(objK);
*** 105,115 ****
// get the size of the object: if the mark we read is not a
// forwarding pointer, then the klass is valid: the klass is only
// overwritten with an overflow next pointer after the object is
// forwarded.
Klass* objK = obj->klass();
! markOop m = obj->mark();
oop new_obj;
if (m->is_marked()) { // Contains forwarding pointer.
new_obj = ParNewGeneration::real_forwardee(obj);
oopDesc::encode_store_heap_oop_not_null(p, new_obj);
log_develop_trace(gc, scavenge)("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
--- 106,116 ----
// get the size of the object: if the mark we read is not a
// forwarding pointer, then the klass is valid: the klass is only
// overwritten with an overflow next pointer after the object is
// forwarded.
Klass* objK = obj->klass();
! markOop m = obj->mark_raw();
oop new_obj;
if (m->is_marked()) { // Contains forwarding pointer.
new_obj = ParNewGeneration::real_forwardee(obj);
oopDesc::encode_store_heap_oop_not_null(p, new_obj);
log_develop_trace(gc, scavenge)("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
< prev index next >