Skip to content

Commit

Permalink
8230677: Should disable Escape Analysis if JVMTI capability can_get_o…
Browse files Browse the repository at this point in the history
…wned_monitor_info was taken

Reviewed-by: sspitsyn, dholmes, kvn
  • Loading branch information
reinrich committed Oct 8, 2019
1 parent 9e17946 commit a683592
Show file tree
Hide file tree
Showing 10 changed files with 1,007 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/hotspot/share/ci/ciEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ void ciEnv::cache_jvmti_state() {
_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();
_jvmti_can_get_owned_monitor_info = JvmtiExport::can_get_owned_monitor_info();
}

bool ciEnv::jvmti_state_changed() const {
Expand All @@ -262,6 +263,10 @@ bool ciEnv::jvmti_state_changed() const {
JvmtiExport::can_pop_frame()) {
return true;
}
if (!_jvmti_can_get_owned_monitor_info &&
JvmtiExport::can_get_owned_monitor_info()) {
return true;
}

return false;
}
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/ci/ciEnv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class ciEnv : StackObj {
bool _jvmti_can_access_local_variables;
bool _jvmti_can_post_on_exceptions;
bool _jvmti_can_pop_frame;
bool _jvmti_can_get_owned_monitor_info; // includes can_get_owned_monitor_stack_depth_info

// Cache DTrace flags
bool _dtrace_extended_probes;
Expand Down Expand Up @@ -347,6 +348,7 @@ class ciEnv : StackObj {
}
bool jvmti_can_hotswap_or_post_breakpoint() const { return _jvmti_can_hotswap_or_post_breakpoint; }
bool jvmti_can_post_on_exceptions() const { return _jvmti_can_post_on_exceptions; }
bool jvmti_can_get_owned_monitor_info() const { return _jvmti_can_get_owned_monitor_info; }

// Cache DTrace flags
void cache_dtrace_flags();
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/opto/c2compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ void C2Compiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci, Dir
assert(is_initialized(), "Compiler thread must be initialized");

bool subsume_loads = SubsumeLoads;
bool do_escape_analysis = DoEscapeAnalysis && !env->should_retain_local_variables();
bool do_escape_analysis = DoEscapeAnalysis && !env->should_retain_local_variables()
&& !env->jvmti_can_get_owned_monitor_info();
bool eliminate_boxing = EliminateAutoBox;

while (!env->failing()) {
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/prims/jvmtiExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,7 @@ bool JvmtiExport::_can_post_method_entry = fals
bool JvmtiExport::_can_post_method_exit = false;
bool JvmtiExport::_can_pop_frame = false;
bool JvmtiExport::_can_force_early_return = false;
bool JvmtiExport::_can_get_owned_monitor_info = false;

bool JvmtiExport::_early_vmstart_recorded = false;

Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/prims/jvmtiExport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class JvmtiExport : public AllStatic {
JVMTI_SUPPORT_FLAG(can_force_early_return)

JVMTI_SUPPORT_FLAG(early_vmstart_recorded)
JVMTI_SUPPORT_FLAG(can_get_owned_monitor_info) // includes can_get_owned_monitor_stack_depth_info

friend class JvmtiEventControllerPrivate; // should only modify these flags
JVMTI_SUPPORT_FLAG(should_post_single_step)
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/prims/jvmtiManageCapabilities.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -367,6 +367,8 @@ void JvmtiManageCapabilities::update() {
JvmtiExport::set_can_pop_frame(avail.can_pop_frame);
JvmtiExport::set_can_force_early_return(avail.can_force_early_return);
JvmtiExport::set_should_clean_up_heap_objects(avail.can_generate_breakpoint_events);
JvmtiExport::set_can_get_owned_monitor_info(avail.can_get_owned_monitor_info ||
avail.can_get_owned_monitor_stack_depth_info);
}

#ifndef PRODUCT
Expand Down
Loading

0 comments on commit a683592

Please sign in to comment.