8199728: Remove oopDesc::is_scavengable
authorstefank
Thu, 15 Mar 2018 21:26:55 +0100
changeset 49452 acb36277a784
parent 49451 e06f9607f370
child 49453 c8ab058dcf1f
8199728: Remove oopDesc::is_scavengable Reviewed-by: kbarrett, pliden
src/hotspot/cpu/x86/x86_32.ad
src/hotspot/cpu/x86/x86_64.ad
src/hotspot/share/ci/ciObject.cpp
src/hotspot/share/code/nmethod.cpp
src/hotspot/share/oops/oop.hpp
src/hotspot/share/oops/oop.inline.hpp
--- a/src/hotspot/cpu/x86/x86_32.ad	Fri Mar 16 22:59:32 2018 -0700
+++ b/src/hotspot/cpu/x86/x86_32.ad	Thu Mar 15 21:26:55 2018 +0100
@@ -391,7 +391,7 @@
         int format) {
 #ifdef ASSERT
   if (rspec.reloc()->type() == relocInfo::oop_type && d32 != 0 && d32 != (int)Universe::non_oop_word()) {
-    assert(oopDesc::is_oop(cast_to_oop(d32)) && (ScavengeRootsInCode || !cast_to_oop(d32)->is_scavengable()), "cannot embed scavengable oops in code");
+    assert(oopDesc::is_oop(cast_to_oop(d32)) && (ScavengeRootsInCode || !Universe::heap()->is_scavengable(cast_to_oop(d32))), "cannot embed scavengable oops in code");
   }
 #endif
   cbuf.relocate(cbuf.insts_mark(), rspec, format);
@@ -786,7 +786,7 @@
   }
   if (cbuf) {
     MacroAssembler _masm(cbuf);
-    // EVEX spills remain EVEX: Compressed displacemement is better than AVX on spill mem operations, 
+    // EVEX spills remain EVEX: Compressed displacemement is better than AVX on spill mem operations,
     //                          it maps more cases to single byte displacement
     _masm.set_managed();
     if (reg_lo+1 == reg_hi) { // double move?
@@ -976,7 +976,7 @@
     dst_offset_size = (tmp_dst_offset == 0) ? 0 : ((tmp_dst_offset < 0x80) ? 1 : 4);
     calc_size += 3+src_offset_size + 3+dst_offset_size;
     break;
-  }   
+  }
   case Op_VecX:
   case Op_VecY:
   case Op_VecZ:
--- a/src/hotspot/cpu/x86/x86_64.ad	Fri Mar 16 22:59:32 2018 -0700
+++ b/src/hotspot/cpu/x86/x86_64.ad	Thu Mar 15 21:26:55 2018 +0100
@@ -669,7 +669,7 @@
   if (rspec.reloc()->type() == relocInfo::oop_type &&
       d32 != 0 && d32 != (intptr_t) Universe::non_oop_word()) {
     assert(Universe::heap()->is_in_reserved((address)(intptr_t)d32), "should be real oop");
-    assert(oopDesc::is_oop(cast_to_oop((intptr_t)d32)) && (ScavengeRootsInCode || !cast_to_oop((intptr_t)d32)->is_scavengable()), "cannot embed scavengable oops in code");
+    assert(oopDesc::is_oop(cast_to_oop((intptr_t)d32)) && (ScavengeRootsInCode || !Universe::heap()->is_scavengable(cast_to_oop((intptr_t)d32))), "cannot embed scavengable oops in code");
   }
 #endif
   cbuf.relocate(cbuf.insts_mark(), rspec, format);
@@ -696,7 +696,7 @@
   if (rspec.reloc()->type() == relocInfo::oop_type &&
       d64 != 0 && d64 != (int64_t) Universe::non_oop_word()) {
     assert(Universe::heap()->is_in_reserved((address)d64), "should be real oop");
-    assert(oopDesc::is_oop(cast_to_oop(d64)) && (ScavengeRootsInCode || !cast_to_oop(d64)->is_scavengable()),
+    assert(oopDesc::is_oop(cast_to_oop(d64)) && (ScavengeRootsInCode || !Universe::heap()->is_scavengable(cast_to_oop(d64))),
            "cannot embed scavengable oops in code");
   }
 #endif
--- a/src/hotspot/share/ci/ciObject.cpp	Fri Mar 16 22:59:32 2018 -0700
+++ b/src/hotspot/share/ci/ciObject.cpp	Thu Mar 15 21:26:55 2018 +0100
@@ -207,7 +207,7 @@
   int flags = 0;
   if (x != NULL) {
     assert(Universe::heap()->is_in_reserved(x), "must be");
-    if (x->is_scavengable())
+    if (Universe::heap()->is_scavengable(x))
       flags |= SCAVENGABLE_FLAG;
   }
   _ident |= flags;
--- a/src/hotspot/share/code/nmethod.cpp	Fri Mar 16 22:59:32 2018 -0700
+++ b/src/hotspot/share/code/nmethod.cpp	Thu Mar 15 21:26:55 2018 +0100
@@ -1683,7 +1683,7 @@
   { NOT_PRODUCT(_print_nm = NULL); }
   bool detected_scavenge_root() { return _detected_scavenge_root; }
   virtual void do_oop(oop* p) {
-    if ((*p) != NULL && (*p)->is_scavengable()) {
+    if ((*p) != NULL && Universe::heap()->is_scavengable(*p)) {
       NOT_PRODUCT(maybe_print(p));
       _detected_scavenge_root = true;
     }
@@ -2178,7 +2178,7 @@
   DebugScavengeRoot(nmethod* nm) : _nm(nm), _ok(true) { }
   bool ok() { return _ok; }
   virtual void do_oop(oop* p) {
-    if ((*p) == NULL || !(*p)->is_scavengable())  return;
+    if ((*p) == NULL || !Universe::heap()->is_scavengable(*p))  return;
     if (_ok) {
       _nm->print_nmethod(true);
       _ok = false;
--- a/src/hotspot/share/oops/oop.hpp	Fri Mar 16 22:59:32 2018 -0700
+++ b/src/hotspot/share/oops/oop.hpp	Thu Mar 15 21:26:55 2018 +0100
@@ -284,8 +284,6 @@
   // garbage collection
   inline bool is_gc_marked() const;
 
-  inline bool is_scavengable() const;
-
   // Forward pointer operations for scavenge
   inline bool is_forwarded() const;
 
--- a/src/hotspot/share/oops/oop.inline.hpp	Fri Mar 16 22:59:32 2018 -0700
+++ b/src/hotspot/share/oops/oop.inline.hpp	Thu Mar 15 21:26:55 2018 +0100
@@ -363,10 +363,6 @@
   return mark()->is_marked();
 }
 
-bool oopDesc::is_scavengable() const {
-  return Universe::heap()->is_scavengable(oop(const_cast<oopDesc*>(this)));
-}
-
 // Used by scavengers
 bool oopDesc::is_forwarded() const {
   // The extra heap check is needed since the obj might be locked, in which case the