< prev index next >

src/hotspot/share/gc/serial/defNewGeneration.inline.hpp

Print this page

        

@@ -28,21 +28,21 @@
 #include "gc/serial/defNewGeneration.hpp"
 #include "gc/shared/cardTableRS.hpp"
 #include "gc/shared/genCollectedHeap.hpp"
 #include "gc/shared/genOopClosures.inline.hpp"
 #include "gc/shared/space.hpp"
+#include "oops/access.inline.hpp"
 
 // Methods of protected closure types
 
 template <class T>
 inline void DefNewGeneration::KeepAliveClosure::do_oop_work(T* p) {
 #ifdef ASSERT
   {
     // We never expect to see a null reference being processed
     // as a weak reference.
-    assert (!oopDesc::is_null(*p), "expected non-null ref");
-    oop obj = oopDesc::load_decode_heap_oop_not_null(p);
+    oop obj = RawAccess<OOP_NOT_NULL>::oop_load(p);
     assert (oopDesc::is_oop(obj), "expected an oop while scanning weak refs");
   }
 #endif // ASSERT
 
   _cl->do_oop_nv(p);

@@ -59,33 +59,32 @@
   //
   // We could check that p is also in the old generation, but
   // dirty cards in the young gen are never scanned, so the
   // extra check probably isn't worthwhile.
   if (GenCollectedHeap::heap()->is_in_reserved(p)) {
-    oop obj = oopDesc::load_decode_heap_oop_not_null(p);
+    oop obj = RawAccess<OOP_NOT_NULL>::oop_load(p);
     _rs->inline_write_ref_field_gc(p, obj);
   }
 }
 
 template <class T>
 inline void DefNewGeneration::FastKeepAliveClosure::do_oop_work(T* p) {
 #ifdef ASSERT
   {
     // We never expect to see a null reference being processed
     // as a weak reference.
-    assert (!oopDesc::is_null(*p), "expected non-null ref");
-    oop obj = oopDesc::load_decode_heap_oop_not_null(p);
+    oop obj = RawAccess<OOP_NOT_NULL>::oop_load(p);
     assert (oopDesc::is_oop(obj), "expected an oop while scanning weak refs");
   }
 #endif // ASSERT
 
   _cl->do_oop_nv(p);
 
   // Optimized for Defnew generation if it's the youngest generation:
   // we set a younger_gen card if we have an older->youngest
   // generation pointer.
-  oop obj = oopDesc::load_decode_heap_oop_not_null(p);
+  oop obj = RawAccess<OOP_NOT_NULL>::oop_load(p);
   if (((HeapWord*)obj < _boundary) && GenCollectedHeap::heap()->is_in_reserved(p)) {
     _rs->inline_write_ref_field_gc(p, obj);
   }
 }
 
< prev index next >