# HG changeset patch # User mdoerr # Date 1547630168 -3600 # Node ID 91ab128a65a319f02348799a0b8c134f0d04f3c0 # Parent cfc839f28b89c5f45037e4dec0d5df6e64bab856 8216556: Unnecessary liveness computation with JVMTI Reviewed-by: redestad, dlong, kvn diff -r cfc839f28b89 -r 91ab128a65a3 src/hotspot/share/ci/ciEnv.cpp --- a/src/hotspot/share/ci/ciEnv.cpp Tue Jan 15 10:23:23 2019 +0100 +++ b/src/hotspot/share/ci/ciEnv.cpp Wed Jan 16 10:16:08 2019 +0100 @@ -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 -r cfc839f28b89 -r 91ab128a65a3 src/hotspot/share/ci/ciEnv.hpp --- a/src/hotspot/share/ci/ciEnv.hpp Tue Jan 15 10:23:23 2019 +0100 +++ b/src/hotspot/share/ci/ciEnv.hpp Wed Jan 16 10:16:08 2019 +0100 @@ -343,7 +343,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 -r cfc839f28b89 -r 91ab128a65a3 src/hotspot/share/ci/ciMethod.cpp --- a/src/hotspot/share/ci/ciMethod.cpp Tue Jan 15 10:23:23 2019 +0100 +++ b/src/hotspot/share/ci/ciMethod.cpp Wed Jan 16 10:16:08 2019 +0100 @@ -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) { // 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