< prev index next >

src/share/vm/code/nmethod.cpp

Print this page
rev 13280 : imported patch CollectedHeap_register_nmethod

@@ -408,15 +408,12 @@
 #endif
 
   _oops_do_mark_link       = NULL;
   _jmethod_id              = NULL;
   _osr_link                = NULL;
-  if (UseG1GC) {
     _unloading_next        = NULL;
-  } else {
     _scavenge_root_link    = NULL;
-  }
   _scavenge_root_state     = 0;
 #if INCLUDE_RTM_OPT
   _rtm_state               = NoRTM;
 #endif
 #if INCLUDE_JVMCI

@@ -596,16 +593,13 @@
     _deopt_mh_handler_begin = (address) this + deoptimize_mh_offset;
 
     code_buffer->copy_code_and_locs_to(this);
     code_buffer->copy_values_to(this);
     if (ScavengeRootsInCode) {
-      if (detect_scavenge_root_oops()) {
-        CodeCache::add_scavenge_root_nmethod(this);
-      }
       Universe::heap()->register_nmethod(this);
     }
-    debug_only(verify_scavenge_root_oops());
+    debug_only(Universe::heap()->verify_nmethod_roots(this));
     CodeCache::commit(this);
   }
 
   if (PrintNativeNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) {
     ttyLocker ttyl;  // keep the following output all in one block

@@ -751,16 +745,13 @@
     // Copy contents of ScopeDescRecorder to nmethod
     code_buffer->copy_values_to(this);
     debug_info->copy_to(this);
     dependencies->copy_to(this);
     if (ScavengeRootsInCode) {
-      if (detect_scavenge_root_oops()) {
-        CodeCache::add_scavenge_root_nmethod(this);
-      }
       Universe::heap()->register_nmethod(this);
     }
-    debug_only(verify_scavenge_root_oops());
+    debug_only(Universe::heap()->verify_nmethod_roots(this));
 
     CodeCache::commit(this);
 
     // Copy contents of ExceptionHandlerTable to nmethod
     handler_table->copy_to(this);

@@ -2133,11 +2124,11 @@
   }
 
   VerifyOopsClosure voc(this);
   oops_do(&voc);
   assert(voc.ok(), "embedded oops must be OK");
-  verify_scavenge_root_oops();
+  Universe::heap()->verify_nmethod_roots(this);
 
   verify_scopes();
 }
 
 

@@ -2226,14 +2217,10 @@
   }
   virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
 };
 
 void nmethod::verify_scavenge_root_oops() {
-  if (UseG1GC) {
-    return;
-  }
-
   if (!on_scavenge_root_list()) {
     // Actually look inside, to verify the claim that it's clean.
     DebugScavengeRoot debug_scavenge_root(this);
     oops_do(&debug_scavenge_root);
     if (!debug_scavenge_root.ok())
< prev index next >