changeset 48588:b60785d4d712 condy

activating condy in the build
author vromero
date Fri, 15 Dec 2017 10:27:17 -0500
parents 9d1bd3ea7ce2
children 14015b37d62f 5811f237a551
files make/CompileJavaModules.gmk src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
diffstat 2 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileJavaModules.gmk	Thu Dec 14 22:04:48 2017 +0100
+++ b/make/CompileJavaModules.gmk	Fri Dec 15 10:27:17 2017 -0500
@@ -272,7 +272,7 @@
 
 ################################################################################
 
-java.rmi_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
+java.rmi_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' -XDcondyForLambda=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	Thu Dec 14 22:04:48 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Fri Dec 15 10:27:17 2017 -0500
@@ -74,8 +74,6 @@
 import com.sun.tools.javac.code.Source;
 import com.sun.tools.javac.code.Symbol.DynamicFieldSymbol;
 
-import static com.sun.tools.javac.jvm.Target.JDK1_10;
-
 /**
  * This pass desugars lambda expressions into static methods
  *
@@ -154,9 +152,9 @@
         attr = Attr.instance(context);
         forceSerializable = options.isSet("forceSerializable");
         Source source = Source.instance(context);
-        Target target = Target.instance(context);
-        condyForLambda = options.isSet("condyForLambda") && target.hasCondy();
-        allowCondyForLambda = Feature.CONDY_FOR_LAMBDA.allowedInSource(source);
+        String condyOp = options.get("condyForLambda");
+        condyForLambda = condyOp != null ? !condyOp.equals("generateIndy") : true &&
+                Feature.CONDY_FOR_LAMBDA.allowedInSource(source);
     }
     // </editor-fold>
 
@@ -1118,7 +1116,6 @@
         }
 
         return  condyForLambda &&
-                allowCondyForLambda &&
                 !context.needsAltMetafactory() &&
                 indy_args.isEmpty() ?
                 makeCondy(tree, syms.lambdaMetafactory, metafactoryName, staticArgs, tree.type, indy_args, samSym.name) :
@@ -1130,7 +1127,6 @@
      * due to the lack of support for condy in the current version of ASM present in the build
      */
     private final boolean condyForLambda;
-    private final boolean allowCondyForLambda;
 
     private JCExpression makeCondy(DiagnosticPosition pos, Type site, Name bsmName,
             List<Object> staticArgs, Type interfaceType, List<JCExpression> indyArgs,