Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8281168: Micro-optimize VarForm.getMemberName for interpreter
Reviewed-by: redestad, vlivanov, mchung
  • Loading branch information
shipilev committed Feb 9, 2022
1 parent bce5dd1 commit fc77217
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/java.base/share/classes/java/lang/invoke/VarForm.java
Expand Up @@ -109,9 +109,14 @@ final MethodType getMethodType(int type) {

@ForceInline
final MemberName getMemberName(int mode) {
MemberName mn = getMemberNameOrNull(mode);
// Can be simplified by calling getMemberNameOrNull, but written in this
// form to improve interpreter/coldpath performance.
MemberName mn = memberName_table[mode];
if (mn == null) {
throw new UnsupportedOperationException();
mn = resolveMemberName(mode);
if (mn == null) {
throw new UnsupportedOperationException();
}
}
return mn;
}
Expand Down

1 comment on commit fc77217

@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.