changeset 49307:25bc0d0e24bf condy-folding

fixing flag settings to allow condy in the build
author vromero
date Wed, 28 Feb 2018 14:06:35 -0500
parents ef964410ab7f
children e51a71b90343
files make/CompileJavaModules.gmk src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
diffstat 2 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileJavaModules.gmk	Tue Feb 27 15:19:12 2018 -0500
+++ b/make/CompileJavaModules.gmk	Wed Feb 28 14:06:35 2018 -0500
@@ -264,7 +264,7 @@
 
 ################################################################################
 
-java.rmi_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' -XDcondyForLambda=generateIndy
+java.rmi_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' -XDforNonCapturingLambda=generateIndy
 java.rmi_CLEAN_FILES += $(wildcard \
     $(TOPDIR)/src/java.rmi/share/classes/sun/rmi/registry/resources/*.properties \
     $(TOPDIR)/src/java.rmi/share/classes/sun/rmi/server/resources/*.properties)
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Tue Feb 27 15:19:12 2018 -0500
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Wed Feb 28 14:06:35 2018 -0500
@@ -151,10 +151,11 @@
         dumpLambdaToMethodStats = options.isSet("debug.dumpLambdaToMethodStats");
         attr = Attr.instance(context);
         forceSerializable = options.isSet("forceSerializable");
-        doConstantFold = options.isSet("doConstantFold");
         Source source = Source.instance(context);
         // format: -XDforNonCapturingLambda=generateCondy, which is the default, or -XDforNonCapturingLambda=generateIndy
-        condyForLambda = Feature.CONDY_FOR_LAMBDA.allowedInSource(source);
+        String condyOp = options.get("forNonCapturingLambda");
+        condyForLambda = condyOp != null ? condyOp.equals("generateCondy") : true &&
+                Feature.CONDY_FOR_LAMBDA.allowedInSource(source);
     }
     // </editor-fold>
 
@@ -1115,15 +1116,13 @@
             }
         }
 
-        return  doConstantFold &&
-                condyForLambda &&
+        return  condyForLambda &&
                 !context.needsAltMetafactory() &&
                 indy_args.isEmpty() ?
                 makeCondy(tree, syms.lambdaMetafactory, metafactoryName, staticArgs, tree.type, indy_args, samSym.name) :
                 makeIndyCall(tree, syms.lambdaMetafactory, metafactoryName, staticArgs, indyType, indy_args, samSym.name);
     }
 
-    private final boolean doConstantFold;
     /* this extra flag should be temporary and used as long as it's not possible to do the build
      * due to the lack of support for condy in the current version of ASM present in the build
      */