src/hotspot/share/oops/methodData.cpp
changeset 55595 cf5a438b3c41
parent 54669 ad45b3802d4e
child 58273 08a5148e7c4e
--- 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;