hg: amber/amber/langtools: adding support for the invocation of trackable instance methods

Vicente Romero vicente.romero at oracle.com
Mon Apr 24 14:48:15 UTC 2017

Hi all,

I have added another patch to provide for uncovered functionality in the 
constant folding project. The class java.lang.invoke.Constable contain 
several classes must of which contain on their own several methods 
annotated with the @TrackableConstant constant annotation. Must of them 
are factory methods but some others are instance methods. In all cases 
the compiler must track the resulting constants in case they are used as 
components to create other constants that could be ldc'ed or indyfied. 
So far there was support for the factory, static, methods but not for 
the instance ones. This patch aims at filling that gap. So now it will 
be possible to write:

         ClassConstant stringClass = ClassConstant.of("Ljava/lang/String;");
         Class<?> stringArrClass = ldc(stringClass.arrayOf());

and the compiler will ldc'ed an String[] class literal.

Thanks in advance for your feedback,

On 04/24/2017 10:38 AM, vicente.romero at oracle.com wrote:
> Changeset: cbbe24c57daf
> Author:    vromero
> Date:      2017-04-24 07:22 -0700
> URL:       http://hg.openjdk.java.net/amber/amber/langtools/rev/cbbe24c57daf
> adding support for the invocation of trackable instance methods
> ! src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ConstFold.java
> ! src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
> ! src/jdk.compiler/share/classes/com/sun/tools/javac/util/DescriptorUtils.java
> ! test/tools/javac/specialConstantFolding/harness/ConstantFoldingHarness.java
> + test/tools/javac/specialConstantFolding/harness/tests/InstanceTrackableMethodsTest.java

More information about the amber-dev mailing list