Skip to content

Commit ff75ad5

Browse files
committed
8258059: Clean up MethodData::profile_unsafe
Reviewed-by: roland, chegar
1 parent b5592c0 commit ff75ad5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/hotspot/share/oops/methodData.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,12 +1586,12 @@ bool MethodData::profile_jsr292(const methodHandle& m, int bci) {
15861586
bool MethodData::profile_unsafe(const methodHandle& m, int bci) {
15871587
Bytecode_invoke inv(m , bci);
15881588
if (inv.is_invokevirtual()) {
1589-
if (inv.klass() == vmSymbols::jdk_internal_misc_Unsafe() ||
1590-
inv.klass() == vmSymbols::sun_misc_Unsafe() ||
1591-
inv.klass() == vmSymbols::jdk_internal_misc_ScopedMemoryAccess()) {
1592-
ResourceMark rm;
1593-
char* name = inv.name()->as_C_string();
1594-
if (!strncmp(name, "get", 3) || !strncmp(name, "put", 3)) {
1589+
Symbol* klass = inv.klass();
1590+
if (klass == vmSymbols::jdk_internal_misc_Unsafe() ||
1591+
klass == vmSymbols::sun_misc_Unsafe() ||
1592+
klass == vmSymbols::jdk_internal_misc_ScopedMemoryAccess()) {
1593+
Symbol* name = inv.name();
1594+
if (name->starts_with("get") || name->starts_with("put")) {
15951595
return true;
15961596
}
15971597
}

0 commit comments

Comments
 (0)