# HG changeset patch # User mdoerr # Date 1547630168 -3600 # Wed Jan 16 10:16:08 2019 +0100 # Node ID be881b88e1d4d32d07af2ca1df61e41afb90af39 # Parent 7bb488236ac96d74d2b2dda79f473f0c9caccd28 8216556: Unnecessary liveness computation with JVMTI Reviewed-by: redestad, dlong, kvn diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp --- a/src/hotspot/share/ci/ciEnv.cpp +++ b/src/hotspot/share/ci/ciEnv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -233,10 +233,6 @@ _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()) { diff --git a/src/hotspot/share/ci/ciEnv.hpp b/src/hotspot/share/ci/ciEnv.hpp --- a/src/hotspot/share/ci/ciEnv.hpp +++ b/src/hotspot/share/ci/ciEnv.hpp @@ -338,7 +338,9 @@ // Cache Jvmti state void cache_jvmti_state(); bool jvmti_state_changed() const; - bool should_retain_local_variables() const; + bool should_retain_local_variables() const { + return _jvmti_can_access_local_variables || _jvmti_can_pop_frame; + } 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; } diff --git a/src/hotspot/share/ci/ciMethod.cpp b/src/hotspot/share/ci/ciMethod.cpp --- a/src/hotspot/share/ci/ciMethod.cpp +++ b/src/hotspot/share/ci/ciMethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -402,12 +402,14 @@ // will return true for all locals in some cases to improve debug // information. MethodLivenessResult ciMethod::liveness_at_bci(int bci) { - MethodLivenessResult result = raw_liveness_at_bci(bci); if (CURRENT_ENV->should_retain_local_variables() || DeoptimizeALot || CompileTheWorld) { // Keep all locals live for the user's edification and amusement. - result.at_put_range(0, result.size(), true); + MethodLivenessResult result(_max_locals); + result.set_range(0, _max_locals); + result.set_is_valid(); + return result; } - return result; + return raw_liveness_at_bci(bci); } // ciMethod::live_local_oops_at_bci