< prev index next >
src/hotspot/share/gc/cms/parOopClosures.inline.hpp
Print this page
@@ -30,14 +30,15 @@
#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/access.inline.hpp"
+#include "oops/compressedOops.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);
+ oop obj = RawAccess<OOP_NOT_NULL>::oop_load(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).
@@ -49,21 +50,20 @@
} else {
size_t obj_sz = obj->size_given_klass(objK);
new_obj = ((ParNewGeneration*)_g)->copy_to_survivor_space(_par_scan_state,
obj, obj_sz, m);
}
- oopDesc::encode_store_heap_oop_not_null(p, new_obj);
+ RawAccess<>::oop_store(p, new_obj);
}
}
inline void ParScanWeakRefClosure::do_oop_nv(oop* p) { ParScanWeakRefClosure::do_oop_work(p); }
inline void ParScanWeakRefClosure::do_oop_nv(narrowOop* p) { ParScanWeakRefClosure::do_oop_work(p); }
template <class T> inline void ParScanClosure::par_do_barrier(T* p) {
assert(generation()->is_in_reserved(p), "expected ref in generation");
- assert(!oopDesc::is_null(*p), "expected non-null object");
- oop obj = oopDesc::load_decode_heap_oop_not_null(p);
+ oop obj = RawAccess<OOP_NOT_NULL>::oop_load(p);
// If p points to a younger generation, mark the card.
if ((HeapWord*)obj < gen_boundary()) {
rs()->write_ref_field_gc_par(p, obj);
}
}
@@ -75,13 +75,13 @@
assert((!CMSHeap::heap()->is_in_reserved(p) ||
generation()->is_in_reserved(p))
&& (CMSHeap::heap()->is_young_gen(generation()) || gc_barrier),
"The gen must be right, and we must be doing the barrier "
"in older generations.");
- T heap_oop = oopDesc::load_heap_oop(p);
- if (!oopDesc::is_null(heap_oop)) {
- oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
+ T heap_oop = RawAccess<>::oop_load(p);
+ if (!CompressedOops::is_null(heap_oop)) {
+ oop obj = CompressedOops::decode_not_null(heap_oop);
if ((HeapWord*)obj < _boundary) {
#ifndef PRODUCT
if (_g->to()->is_in_reserved(obj)) {
Log(gc) log;
log.error("Scanning field (" PTR_FORMAT ") twice?", p2i(p));
@@ -109,18 +109,18 @@
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);
+ RawAccess<OOP_NOT_NULL>::oop_store(p, new_obj);
log_develop_trace(gc, scavenge)("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
"forwarded ",
new_obj->klass()->internal_name(), p2i(p), p2i((void *)obj), p2i((void *)new_obj), new_obj->size());
} else {
size_t obj_sz = obj->size_given_klass(objK);
new_obj = _g->copy_to_survivor_space(_par_scan_state, obj, obj_sz, m);
- oopDesc::encode_store_heap_oop_not_null(p, new_obj);
+ RawAccess<OOP_NOT_NULL>::oop_store(p, new_obj);
if (root_scan) {
// This may have pushed an object. If we have a root
// category with a lot of roots, can't let the queue get too
// full:
(void)_par_scan_state->trim_queues(10 * ParallelGCThreads);
< prev index next >