src/hotspot/share/code/nmethod.cpp
changeset 48007 ab3959df2115
parent 47794 e84aa2c71241
child 48167 f04a848c6f00
--- a/src/hotspot/share/code/nmethod.cpp	Mon Nov 20 17:10:02 2017 -0500
+++ b/src/hotspot/share/code/nmethod.cpp	Mon Nov 20 19:00:22 2017 -0800
@@ -386,7 +386,7 @@
 
 // Fill in default values for various flag fields
 void nmethod::init_defaults() {
-  _state                      = in_use;
+  _state                      = not_installed;
   _has_flushed_dependencies   = 0;
   _lock_count                 = 0;
   _stack_traversal_mark       = 0;
@@ -445,6 +445,7 @@
     nm->log_new_nmethod();
   }
 
+  nm->make_in_use();
   return nm;
 }
 
@@ -1129,7 +1130,7 @@
 /**
  * Common functionality for both make_not_entrant and make_zombie
  */
-bool nmethod::make_not_entrant_or_zombie(unsigned int state) {
+bool nmethod::make_not_entrant_or_zombie(int state) {
   assert(state == zombie || state == not_entrant, "must be zombie or not_entrant");
   assert(!is_zombie(), "should not already be a zombie");
 
@@ -2097,9 +2098,7 @@
 
 void nmethod::verify_interrupt_point(address call_site) {
   // Verify IC only when nmethod installation is finished.
-  bool is_installed = (method()->code() == this) // nmethod is in state 'in_use' and installed
-                      || !this->is_in_use();     // nmethod is installed, but not in 'in_use' state
-  if (is_installed) {
+  if (!is_not_installed()) {
     Thread *cur = Thread::current();
     if (CompiledIC_lock->owner() == cur ||
         ((cur->is_VM_thread() || cur->is_ConcurrentGC_thread()) &&