changeset 52460:3d8927d60749 cont

Record monitor usage in nmethods created by JVMCI.
author dmacgregor
date Thu, 08 Nov 2018 14:37:42 +0000
parents a295a6923aea
children d28f94c4cddb 6903765127bd
files src/hotspot/share/jvmci/jvmciCodeInstaller.cpp src/hotspot/share/jvmci/jvmciCodeInstaller.hpp src/hotspot/share/jvmci/jvmciEnv.cpp src/hotspot/share/jvmci/jvmciEnv.hpp
diffstat 4 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp	Tue Nov 06 16:09:05 2018 +0000
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp	Thu Nov 08 14:37:42 2018 +0000
@@ -668,7 +668,7 @@
     result = JVMCIEnv::register_method(method, nm, entry_bci, &_offsets, _orig_pc_offset, &buffer,
                                        stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table,
                                        compiler, _debug_recorder, _dependencies, env, id,
-                                       has_unsafe_access, _has_wide_vector, installed_code, compiled_code, speculation_log);
+                                       _has_monitors, has_unsafe_access, _has_wide_vector, installed_code, compiled_code, speculation_log);
     cb = nm->as_codeblob_or_null();
     if (nm != NULL && env == NULL) {
       DirectiveSet* directive = DirectivesStack::getMatchingDirective(method, compiler);
@@ -1111,6 +1111,9 @@
     jint local_count = BytecodeFrame::numLocals(frame);
     jint expression_count = BytecodeFrame::numStack(frame);
     jint monitor_count = BytecodeFrame::numLocks(frame);
+    if (monitor_count > 0 && !_has_monitors) {
+      _has_monitors = true;
+    }
     objArrayHandle values(THREAD, BytecodeFrame::values(frame));
     objArrayHandle slotKinds(THREAD, BytecodeFrame::slotKinds(frame));
 
--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp	Tue Nov 06 16:09:05 2018 +0000
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp	Thu Nov 08 14:37:42 2018 +0000
@@ -157,6 +157,7 @@
   jobject       _comments_handle;
 #endif
 
+  bool          _has_monitors;
   bool          _has_wide_vector;
   jobject       _word_kind_handle;
 
--- a/src/hotspot/share/jvmci/jvmciEnv.cpp	Tue Nov 06 16:09:05 2018 +0000
+++ b/src/hotspot/share/jvmci/jvmciEnv.cpp	Thu Nov 08 14:37:42 2018 +0000
@@ -453,6 +453,7 @@
                                 Dependencies* dependencies,
                                 JVMCIEnv* env,
                                 int compile_id,
+                                bool has_monitors,
                                 bool has_unsafe_access,
                                 bool has_wide_vector,
                                 Handle installed_code,
@@ -526,6 +527,7 @@
       } else {
         nm->set_has_unsafe_access(has_unsafe_access);
         nm->set_has_wide_vectors(has_wide_vector);
+        nm->set_has_monitors(has_monitors);
 
         // Record successful registration.
         // (Put nm into the task handle *before* publishing to the Java heap.)
--- a/src/hotspot/share/jvmci/jvmciEnv.hpp	Tue Nov 06 16:09:05 2018 +0000
+++ b/src/hotspot/share/jvmci/jvmciEnv.hpp	Thu Nov 08 14:37:42 2018 +0000
@@ -168,6 +168,7 @@
                        Dependencies*             dependencies,
                        JVMCIEnv*                 env,
                        int                       compile_id,
+                       bool                      has_monitors,
                        bool                      has_unsafe_access,
                        bool                      has_wide_vector,
                        Handle                    installed_code,