Mercurial > hg > graal-compiler
diff src/share/vm/code/nmethod.cpp @ 9023:f94bb5d20e5d
Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 11 Apr 2013 17:36:46 +0200 |
parents | b9a918201d47 |
children | 9a3e25e270a0 |
line wrap: on
line diff
--- a/src/share/vm/code/nmethod.cpp Thu Apr 11 13:03:20 2013 +0200 +++ b/src/share/vm/code/nmethod.cpp Thu Apr 11 17:36:46 2013 +0200 @@ -1306,13 +1306,6 @@ _method = NULL; // Clear the method of this dead nmethod } -#ifdef GRAAL - if (_graal_installed_code != NULL) { - HotSpotInstalledCode::set_nmethod(_graal_installed_code, 0); - _graal_installed_code = NULL; - } -#endif - // Make the class unloaded - i.e., change state and notify sweeper assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint"); if (is_in_use()) { @@ -1394,18 +1387,17 @@ return false; } -#ifdef GRAAL - if (_graal_installed_code != NULL) { - HotSpotInstalledCode::set_nmethod(_graal_installed_code, 0); - _graal_installed_code = NULL; - } -#endif - // The caller can be calling the method statically or through an inline // cache call. if (!is_osr_method() && !is_not_entrant()) { - NativeJump::patch_verified_entry(entry_point(), verified_entry_point(), - SharedRuntime::get_handle_wrong_method_stub()); + if (_graal_installed_code != NULL && !HotSpotInstalledCode::isDefault(_graal_installed_code)) { + // This was manually installed machine code. Patch entry with stub that throws an exception. + NativeJump::patch_verified_entry(entry_point(), verified_entry_point(), + SharedRuntime::get_deoptimized_installed_code_stub()); + } else { + NativeJump::patch_verified_entry(entry_point(), verified_entry_point(), + SharedRuntime::get_handle_wrong_method_stub()); + } } if (is_in_use()) {