mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8292917: [JVMCI] Extend InstalledCode API to make an nmethod non entrant.
Reviewed-by: never
This commit is contained in:
parent
1500d3dfb2
commit
b0e0b87891
8 changed files with 52 additions and 27 deletions
|
@ -1510,7 +1510,7 @@ void JVMCIEnv::initialize_installed_code(JVMCIObject installed_code, CodeBlob* c
|
|||
}
|
||||
|
||||
|
||||
void JVMCIEnv::invalidate_nmethod_mirror(JVMCIObject mirror, JVMCI_TRAPS) {
|
||||
void JVMCIEnv::invalidate_nmethod_mirror(JVMCIObject mirror, bool deoptimize, JVMCI_TRAPS) {
|
||||
if (mirror.is_null()) {
|
||||
JVMCI_THROW(NullPointerException);
|
||||
}
|
||||
|
@ -1529,8 +1529,13 @@ void JVMCIEnv::invalidate_nmethod_mirror(JVMCIObject mirror, JVMCI_TRAPS) {
|
|||
"Cannot invalidate HotSpotNmethod object in shared library VM heap from non-JavaThread");
|
||||
}
|
||||
|
||||
// Invalidating the HotSpotNmethod means we want the nmethod to be deoptimized.
|
||||
Deoptimization::deoptimize_all_marked(nm);
|
||||
if (!deoptimize) {
|
||||
// Prevent future executions of the nmethod but let current executions complete.
|
||||
nm->make_not_entrant();
|
||||
} else {
|
||||
// We want the nmethod to be deoptimized immediately.
|
||||
Deoptimization::deoptimize_all_marked(nm);
|
||||
}
|
||||
|
||||
// A HotSpotNmethod instance can only reference a single nmethod
|
||||
// during its lifetime so simply clear it here.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue