hg: amber/amber/langtools: refactoring of constant folding code, creation of a new visitor after Flow

vicente.romero at oracle.com vicente.romero at oracle.com
Tue Sep 12 20:41:57 UTC 2017


Changeset: f85d76645509
Author:    vromero
Date:      2017-09-12 16:33 -0400
URL:       http://hg.openjdk.java.net/amber/amber/langtools/rev/f85d76645509

refactoring of constant folding code, creation of a new visitor after Flow
main changes:
* the new class ConstablesVisitor has been created, it contains all
  constables related code that previously was in ConstFold plus some
  actions done before in Attr, like folding of binary and unary expressions
* Intrinsics.invokedynamic is treated as a poly signature method
* most constables related code has been removed from Attr
Some of the benefits of having this new visitor after Flow is that
by the time it executes, the compiler already knows for sure what
variables are effectively final and thus usable as constables or as
subexpressions to build constables.

! src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ConstFold.java
+ src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ConstablesVisitor.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Items.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Pool.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java
! test/tools/javac/specialConstantFolding/EffectivelyFinalTestNeg.out



More information about the amber-dev mailing list