changeset 55595:cf5a438b3c41

8226409: Enable argument profiling for sun.misc.Unsafe.put*/get* Reviewed-by: kvn
author vlivanov
date Fri, 05 Jul 2019 12:55:54 +0300
parents 66a748c4f3ff
children d01b345865d7
files src/hotspot/share/classfile/vmSymbols.hpp src/hotspot/share/oops/methodData.cpp
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/classfile/vmSymbols.hpp	Fri Jul 05 11:07:09 2019 +0200
+++ b/src/hotspot/share/classfile/vmSymbols.hpp	Fri Jul 05 12:55:54 2019 +0300
@@ -1088,6 +1088,7 @@
                                                                                                                         \
   /* support for Unsafe */                                                                                              \
   do_class(jdk_internal_misc_Unsafe,               "jdk/internal/misc/Unsafe")                                          \
+  do_class(sun_misc_Unsafe,                        "sun/misc/Unsafe")                                                   \
                                                                                                                         \
   do_intrinsic(_allocateInstance,         jdk_internal_misc_Unsafe,     allocateInstance_name, allocateInstance_signature, F_RN) \
    do_name(     allocateInstance_name,                                  "allocateInstance")                                      \
--- a/src/hotspot/share/oops/methodData.cpp	Fri Jul 05 11:07:09 2019 +0200
+++ b/src/hotspot/share/oops/methodData.cpp	Fri Jul 05 12:55:54 2019 +0300
@@ -1607,11 +1607,14 @@
 
 bool MethodData::profile_unsafe(const methodHandle& m, int bci) {
   Bytecode_invoke inv(m , bci);
-  if (inv.is_invokevirtual() && inv.klass() == vmSymbols::jdk_internal_misc_Unsafe()) {
-    ResourceMark rm;
-    char* name = inv.name()->as_C_string();
-    if (!strncmp(name, "get", 3) || !strncmp(name, "put", 3)) {
-      return true;
+  if (inv.is_invokevirtual()) {
+    if (inv.klass() == vmSymbols::jdk_internal_misc_Unsafe() ||
+        inv.klass() == vmSymbols::sun_misc_Unsafe()) {
+      ResourceMark rm;
+      char* name = inv.name()->as_C_string();
+      if (!strncmp(name, "get", 3) || !strncmp(name, "put", 3)) {
+        return true;
+      }
     }
   }
   return false;