mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 03:54:33 +02:00
8035493: JVMTI PopFrame capability must instruct compilers not to prune locals
Reviewed-by: kvn, sla, coleenp, sspitsyn
This commit is contained in:
parent
70c77b3470
commit
68857c9469
9 changed files with 48 additions and 17 deletions
|
@ -136,6 +136,11 @@ ciEnv::ciEnv(CompileTask* task, int system_dictionary_modification_counter) {
|
|||
_ClassCastException_instance = NULL;
|
||||
_the_null_string = NULL;
|
||||
_the_min_jint_string = NULL;
|
||||
|
||||
_jvmti_can_hotswap_or_post_breakpoint = false;
|
||||
_jvmti_can_access_local_variables = false;
|
||||
_jvmti_can_post_on_exceptions = false;
|
||||
_jvmti_can_pop_frame = false;
|
||||
}
|
||||
|
||||
ciEnv::ciEnv(Arena* arena) {
|
||||
|
@ -186,6 +191,11 @@ ciEnv::ciEnv(Arena* arena) {
|
|||
_ClassCastException_instance = NULL;
|
||||
_the_null_string = NULL;
|
||||
_the_min_jint_string = NULL;
|
||||
|
||||
_jvmti_can_hotswap_or_post_breakpoint = false;
|
||||
_jvmti_can_access_local_variables = false;
|
||||
_jvmti_can_post_on_exceptions = false;
|
||||
_jvmti_can_pop_frame = false;
|
||||
}
|
||||
|
||||
ciEnv::~ciEnv() {
|
||||
|
@ -205,6 +215,31 @@ void ciEnv::cache_jvmti_state() {
|
|||
_jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint();
|
||||
_jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables();
|
||||
_jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions();
|
||||
_jvmti_can_pop_frame = JvmtiExport::can_pop_frame();
|
||||
}
|
||||
|
||||
bool ciEnv::should_retain_local_variables() const {
|
||||
return _jvmti_can_access_local_variables || _jvmti_can_pop_frame;
|
||||
}
|
||||
|
||||
bool ciEnv::jvmti_state_changed() const {
|
||||
if (!_jvmti_can_access_local_variables &&
|
||||
JvmtiExport::can_access_local_variables()) {
|
||||
return true;
|
||||
}
|
||||
if (!_jvmti_can_hotswap_or_post_breakpoint &&
|
||||
JvmtiExport::can_hotswap_or_post_breakpoint()) {
|
||||
return true;
|
||||
}
|
||||
if (!_jvmti_can_post_on_exceptions &&
|
||||
JvmtiExport::can_post_on_exceptions()) {
|
||||
return true;
|
||||
}
|
||||
if (!_jvmti_can_pop_frame &&
|
||||
JvmtiExport::can_pop_frame()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@ -940,13 +975,7 @@ void ciEnv::register_method(ciMethod* target,
|
|||
No_Safepoint_Verifier nsv;
|
||||
|
||||
// Change in Jvmti state may invalidate compilation.
|
||||
if (!failing() &&
|
||||
( (!jvmti_can_hotswap_or_post_breakpoint() &&
|
||||
JvmtiExport::can_hotswap_or_post_breakpoint()) ||
|
||||
(!jvmti_can_access_local_variables() &&
|
||||
JvmtiExport::can_access_local_variables()) ||
|
||||
(!jvmti_can_post_on_exceptions() &&
|
||||
JvmtiExport::can_post_on_exceptions()) )) {
|
||||
if (!failing() && jvmti_state_changed()) {
|
||||
record_failure("Jvmti state change invalidated dependencies");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue