mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-11 14:11:36 +00:00
8295225: [JVMCI] codeStart should be cleared when entryPoint is cleared
Reviewed-by: never
This commit is contained in:
parent
26ac836636
commit
03e63a2b87
@ -1616,6 +1616,7 @@ CodeBlob* JVMCIEnv::get_code_blob(JVMCIObject obj) {
|
||||
// nmethod in the code cache.
|
||||
set_InstalledCode_address(obj, 0);
|
||||
set_InstalledCode_entryPoint(obj, 0);
|
||||
set_HotSpotInstalledCode_codeStart(obj, 0);
|
||||
}
|
||||
return nm;
|
||||
}
|
||||
|
||||
@ -820,11 +820,13 @@ void JVMCINMethodData::invalidate_nmethod_mirror(nmethod* nm) {
|
||||
// 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);
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -91,15 +91,18 @@ public class InvalidateInstalledCodeTest extends CodeInstallerTest {
|
||||
|
||||
Asserts.assertTrue(nmethod.isValid(), testCase + " : code is not valid, i = " + nmethod);
|
||||
Asserts.assertTrue(nmethod.isAlive(), testCase + " : code is not alive, i = " + nmethod);
|
||||
Asserts.assertNotEquals(nmethod.getStart(), 0L);
|
||||
|
||||
// Make nmethod non-entrant but still alive
|
||||
CompilerToVMHelper.invalidateHotSpotNmethod(nmethod, false);
|
||||
Asserts.assertFalse(nmethod.isValid(), testCase + " : code is valid, i = " + nmethod);
|
||||
Asserts.assertTrue(nmethod.isAlive(), testCase + " : code is not alive, i = " + nmethod);
|
||||
Asserts.assertEquals(nmethod.getStart(), 0L);
|
||||
|
||||
// Deoptimize the nmethod and cut the link to it from the HotSpotNmethod
|
||||
CompilerToVMHelper.invalidateHotSpotNmethod(nmethod, true);
|
||||
Asserts.assertFalse(nmethod.isValid(), testCase + " : code is valid, i = " + nmethod);
|
||||
Asserts.assertFalse(nmethod.isAlive(), testCase + " : code is alive, i = " + nmethod);
|
||||
Asserts.assertEquals(nmethod.getStart(), 0L);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user