< prev index next >

src/hotspot/share/jvmci/jvmciRuntime.cpp

Print this page
*** 795,11 ***
    // (re)register it with the heap.
    MutexLocker ml(CodeCache_lock, Mutex::_no_safepoint_check_flag);
    Universe::heap()->register_nmethod(nm);
  }
  
! void JVMCINMethodData::invalidate_nmethod_mirror(nmethod* nm) {
    oop nmethod_mirror = get_nmethod_mirror(nm);
    if (nmethod_mirror == nullptr) {
      return;
    }
  
--- 795,11 ---
    // (re)register it with the heap.
    MutexLocker ml(CodeCache_lock, Mutex::_no_safepoint_check_flag);
    Universe::heap()->register_nmethod(nm);
  }
  
! void JVMCINMethodData::invalidate_nmethod_mirror(nmethod* nm, nmethod::InvalidationReason invalidation_reason) {
    oop nmethod_mirror = get_nmethod_mirror(nm);
    if (nmethod_mirror == nullptr) {
      return;
    }
  

*** 814,16 ***
--- 814,24 ---
        // future invocations via the mirror will result in
        // an InvalidInstalledCodeException.
        HotSpotJVMCI::InstalledCode::set_address(jvmciEnv, nmethod_mirror, 0);
        HotSpotJVMCI::InstalledCode::set_entryPoint(jvmciEnv, nmethod_mirror, 0);
        HotSpotJVMCI::HotSpotInstalledCode::set_codeStart(jvmciEnv, nmethod_mirror, 0);
+       if (HotSpotJVMCI::HotSpotNmethod::invalidationReason(jvmciEnv, nmethod_mirror) ==
+         static_cast<int>(nmethod::InvalidationReason::NOT_INVALIDATED)) {
+         HotSpotJVMCI::HotSpotNmethod::set_invalidationReason(jvmciEnv, nmethod_mirror, static_cast<int>(invalidation_reason));
+       }
      } else if (nm->is_not_entrant()) {
        // Zero the entry point so any new invocation will fail but keep
        // the address link around that so that existing activations can
        // be deoptimized via the mirror (i.e. JVMCIEnv::invalidate_installed_code).
        HotSpotJVMCI::InstalledCode::set_entryPoint(jvmciEnv, nmethod_mirror, 0);
        HotSpotJVMCI::HotSpotInstalledCode::set_codeStart(jvmciEnv, nmethod_mirror, 0);
+       if (HotSpotJVMCI::HotSpotNmethod::invalidationReason(jvmciEnv, nmethod_mirror) ==
+         static_cast<int>(nmethod::InvalidationReason::NOT_INVALIDATED)) {
+         HotSpotJVMCI::HotSpotNmethod::set_invalidationReason(jvmciEnv, nmethod_mirror, static_cast<int>(invalidation_reason));
+       }
      }
    }
  
    if (_nmethod_mirror_index != -1 && nm->is_unloading()) {
      // Drop the reference to the nmethod mirror object but don't clear the actual oop reference.  Otherwise

*** 2182,11 ***
                ResourceMark rm;
                char *method_name = method->name_and_sig_as_C_string();
                tty->print_cr("Replacing method %s", method_name);
              }
              if (old != nullptr) {
!               old->make_not_entrant("JVMCI register method");
              }
  
              LogTarget(Info, nmethod, install) lt;
              if (lt.is_enabled()) {
                ResourceMark rm;
--- 2190,11 ---
                ResourceMark rm;
                char *method_name = method->name_and_sig_as_C_string();
                tty->print_cr("Replacing method %s", method_name);
              }
              if (old != nullptr) {
!               old->make_not_entrant(nmethod::InvalidationReason::JVMCI_REPLACED_WITH_NEW_CODE);
              }
  
              LogTarget(Info, nmethod, install) lt;
              if (lt.is_enabled()) {
                ResourceMark rm;
< prev index next >