Skip to content

Commit

Permalink
8258059: Clean up MethodData::profile_unsafe
Browse files Browse the repository at this point in the history
Reviewed-by: roland, chegar
  • Loading branch information
cl4es committed Dec 11, 2020
1 parent b5592c0 commit ff75ad5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/hotspot/share/oops/methodData.cpp
Expand Up @@ -1586,12 +1586,12 @@ bool MethodData::profile_jsr292(const methodHandle& m, int bci) {
bool MethodData::profile_unsafe(const methodHandle& m, int bci) {
Bytecode_invoke inv(m , bci);
if (inv.is_invokevirtual()) {
if (inv.klass() == vmSymbols::jdk_internal_misc_Unsafe() ||
inv.klass() == vmSymbols::sun_misc_Unsafe() ||
inv.klass() == vmSymbols::jdk_internal_misc_ScopedMemoryAccess()) {
ResourceMark rm;
char* name = inv.name()->as_C_string();
if (!strncmp(name, "get", 3) || !strncmp(name, "put", 3)) {
Symbol* klass = inv.klass();
if (klass == vmSymbols::jdk_internal_misc_Unsafe() ||
klass == vmSymbols::sun_misc_Unsafe() ||
klass == vmSymbols::jdk_internal_misc_ScopedMemoryAccess()) {
Symbol* name = inv.name();
if (name->starts_with("get") || name->starts_with("put")) {
return true;
}
}
Expand Down

1 comment on commit ff75ad5

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.