# HG changeset patch # User vlivanov # Date 1562320554 -10800 # Node ID cf5a438b3c41aa4c742a4456a9c48ecbb6dcf90e # Parent 66a748c4f3ff315121dd4bebcb3122d9287fac18 8226409: Enable argument profiling for sun.misc.Unsafe.put*/get* Reviewed-by: kvn diff -r 66a748c4f3ff -r cf5a438b3c41 src/hotspot/share/classfile/vmSymbols.hpp --- 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") \ diff -r 66a748c4f3ff -r cf5a438b3c41 src/hotspot/share/oops/methodData.cpp --- 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;