Mercurial > hg > truffle
comparison src/share/vm/code/nmethod.cpp @ 9046:c6a1ffc707ff
Comments and #ifdef GRAAL for recent changes to C++ code for calling nmethods directly.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 12 Apr 2013 17:22:54 +0200 |
parents | 9a3e25e270a0 |
children | fe9a18fbb15e 197426668a5d |
comparison
equal
deleted
inserted
replaced
9030:9a3e25e270a0 | 9046:c6a1ffc707ff |
---|---|
1305 } | 1305 } |
1306 _method = NULL; // Clear the method of this dead nmethod | 1306 _method = NULL; // Clear the method of this dead nmethod |
1307 } | 1307 } |
1308 | 1308 |
1309 #ifdef GRAAL | 1309 #ifdef GRAAL |
1310 if (_graal_installed_code != NULL) { | 1310 // The method can only be unloaded after the pointer to the installed code |
1311 _graal_installed_code = NULL; | 1311 // Java wrapper is no longer alive. Here we need to clear out this weak |
1312 } | 1312 // reference to the dead object. |
1313 if (_graal_installed_code != NULL) { | |
1314 _graal_installed_code = NULL; | |
1315 } | |
1313 #endif | 1316 #endif |
1314 | 1317 |
1315 // Make the class unloaded - i.e., change state and notify sweeper | 1318 // Make the class unloaded - i.e., change state and notify sweeper |
1316 assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint"); | 1319 assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint"); |
1317 if (is_in_use()) { | 1320 if (is_in_use()) { |
1394 } | 1397 } |
1395 | 1398 |
1396 // The caller can be calling the method statically or through an inline | 1399 // The caller can be calling the method statically or through an inline |
1397 // cache call. | 1400 // cache call. |
1398 if (!is_osr_method() && !is_not_entrant()) { | 1401 if (!is_osr_method() && !is_not_entrant()) { |
1402 address stub = SharedRuntime::get_handle_wrong_method_stub(); | |
1403 #ifdef GRAAL | |
1399 if (_graal_installed_code != NULL && !HotSpotInstalledCode::isDefault(_graal_installed_code)) { | 1404 if (_graal_installed_code != NULL && !HotSpotInstalledCode::isDefault(_graal_installed_code)) { |
1400 // This was manually installed machine code. Patch entry with stub that throws an exception. | 1405 // This was manually installed machine code. Patch entry with stub that throws an exception. |
1401 NativeJump::patch_verified_entry(entry_point(), verified_entry_point(), | 1406 stub = SharedRuntime::get_deoptimized_installed_code_stub(); |
1402 SharedRuntime::get_deoptimized_installed_code_stub()); | 1407 } |
1403 } else { | 1408 #endif |
1404 NativeJump::patch_verified_entry(entry_point(), verified_entry_point(), | 1409 NativeJump::patch_verified_entry(entry_point(), verified_entry_point(), stub); |
1405 SharedRuntime::get_handle_wrong_method_stub()); | |
1406 } | |
1407 } | 1410 } |
1408 | 1411 |
1409 if (is_in_use()) { | 1412 if (is_in_use()) { |
1410 // It's a true state change, so mark the method as decompiled. | 1413 // It's a true state change, so mark the method as decompiled. |
1411 // Do it only for transition from alive. | 1414 // Do it only for transition from alive. |