Skip to content

Commit

Permalink
Fix dedup - part 1
Browse files Browse the repository at this point in the history
Lower unnecessarily rewrites symbols for Foo.class where Foo is a reference class.
We still have an issue with Lower generating "random" tmp local names.
  • Loading branch information
mcimadamore committed Jun 13, 2024
1 parent 8a9a17f commit 56f9e50
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4700,7 +4700,7 @@ public void visitSelect(JCFieldAccess tree) {
TreeInfo.name(tree.selected) == names._super &&
!types.isDirectSuperInterface(((JCFieldAccess)tree.selected).selected.type.tsym, currentClass);
tree.selected = translate(tree.selected);
if (tree.name == names._class) {
if (tree.name == names._class && tree.selected.type.isPrimitiveOrVoid()) {
result = classOf(tree.selected);
}
else if (tree.name == names._super &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,14 @@ void f() {}
group((Function<Object, Integer>) x -> x instanceof Integer i ? i : -1,
(Function<Object, Integer>) x -> x instanceof Integer i ? i : -1);

group((Function<Object, Integer>) x -> x instanceof R(var i1, var i2) ? i1 : -1,
(Function<Object, Integer>) x -> x instanceof R(var i1, var i2) ? i1 : -1 );

group((Function<Object, Integer>) x -> x instanceof R(Integer i1, int i2) ? i2 : -1,
(Function<Object, Integer>) x -> x instanceof R(Integer i1, int i2) ? i2 : -1 );
// disabled for now, as Lower generates random tmp variable names (using tree position)
// this should be fixed using a more reliable name generation scheme (like TransPatterns)

// group((Function<Object, Integer>) x -> x instanceof R(var i1, var i2) ? i1 : -1,
// (Function<Object, Integer>) x -> x instanceof R(var i1, var i2) ? i1 : -1 );
//
// group((Function<Object, Integer>) x -> x instanceof R(Integer i1, int i2) ? i2 : -1,
// (Function<Object, Integer>) x -> x instanceof R(Integer i1, int i2) ? i2 : -1 );
}

void f() {}
Expand Down

0 comments on commit 56f9e50

Please sign in to comment.