changeset 53371:91ab128a65a3

8216556: Unnecessary liveness computation with JVMTI Reviewed-by: redestad, dlong, kvn
author mdoerr
date Wed, 16 Jan 2019 10:16:08 +0100
parents cfc839f28b89
children 61866ba87b31
files src/hotspot/share/ci/ciEnv.cpp src/hotspot/share/ci/ciEnv.hpp src/hotspot/share/ci/ciMethod.cpp
diffstat 3 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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()) {
--- 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; }
 
--- 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