changeset 48437:12ca0c5b5496 condy-folding

restoring some lambda-condy lost bits
author vromero
date Fri, 08 Dec 2017 20:22:40 -0500
parents 4f3d4d44ab66
children 41935fb86f84
files src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Items.java
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu Dec 07 22:06:52 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Fri Dec 08 20:22:40 2017 -0500
@@ -2057,10 +2057,10 @@
                 res = items.makeMemberItem(sym, true);
             }
             result = res;
+        } else if (isInvokeDynamic(sym) || isLambdaCondy(sym)) {
+            result = items.makeDynamicItem(sym);
         } else if (sym.kind == VAR && sym.owner.kind == MTH) {
             result = items.makeLocalItem((VarSymbol)sym);
-        } else if (isInvokeDynamic(sym)) {
-            result = items.makeDynamicItem(sym);
         } else if ((sym.flags() & STATIC) != 0) {
             if (!isAccessSuper(env.enclMethod))
                 sym = binaryQualifier(sym, env.enclClass.type);
@@ -2072,6 +2072,12 @@
         }
     }
 
+    public boolean isLambdaCondy(Symbol sym) {
+        return sym.kind == VAR &&
+                sym instanceof DynamicFieldSymbol &&
+                ((DynamicFieldSymbol)sym).isDynamic();
+    }
+
     public void visitSelect(JCFieldAccess tree) {
         Symbol sym = tree.sym;
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Items.java	Thu Dec 07 22:06:52 2017 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Items.java	Fri Dec 08 20:22:40 2017 -0500
@@ -508,7 +508,11 @@
         }
 
         Item load() {
-            throw new AssertionError();
+            Assert.check(member.kind == Kind.VAR);
+            Type type = member.erasure(types);
+            int rescode = Code.typecode(type);
+            code.emitLdc(pool.put(member));
+            return stackItem[rescode];
         }
 
         void store() {