Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
biboudis committed Apr 4, 2024
1 parent 95e153b commit 8564251
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,13 @@ private void handleSwitch(JCTree tree,
.toArray(s -> new LoadableConstant[s]);

boolean enumSelector = seltype.tsym.isEnum();
boolean primitiveSelector = seltype.isPrimitive();
Name bootstrapName = enumSelector ? names.enumSwitch : names.typeSwitch;
MethodSymbol bsm = rs.resolveInternalMethod(tree.pos(), env, syms.switchBootstrapsType,
bootstrapName, staticArgTypes, List.nil());

Type resolvedSelectorType = syms.objectType;
if (target.releaseAfterJEP455())
resolvedSelectorType = seltype;
Type resolvedSelectorType = seltype;
if (target.usesReferenceOnlySelectorTypes())
resolvedSelectorType = syms.objectType;

MethodType indyType = new MethodType(
List.of(resolvedSelectorType, syms.intType),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public boolean optimizeOuterThis() {

/** Releases prior to JDK 23 expect a less precise SwitchBootstraps.typeSwitch signature on the selectorType
*/
public boolean releaseAfterJEP455() {
return compareTo(Target.JDK1_23) >= 0;
public boolean usesReferenceOnlySelectorTypes() {
return compareTo(Target.JDK1_23) < 0;
}
}

0 comments on commit 8564251

Please sign in to comment.