src/share/classes/com/sun/tools/javac/jvm/Gen.java

changeset 1336
26d93df3905a
parent 1326
30c36e23f154
child 1358
fc123bdeddb8
equal deleted inserted replaced
1335:99983a4a593b 1336:26d93df3905a
2101 res = items.makeMemberItem(sym, true); 2101 res = items.makeMemberItem(sym, true);
2102 } 2102 }
2103 result = res; 2103 result = res;
2104 } else if (sym.kind == VAR && sym.owner.kind == MTH) { 2104 } else if (sym.kind == VAR && sym.owner.kind == MTH) {
2105 result = items.makeLocalItem((VarSymbol)sym); 2105 result = items.makeLocalItem((VarSymbol)sym);
2106 } else if (isInvokeDynamic(sym)) {
2107 result = items.makeDynamicItem(sym);
2106 } else if ((sym.flags() & STATIC) != 0) { 2108 } else if ((sym.flags() & STATIC) != 0) {
2107 if (!isAccessSuper(env.enclMethod)) 2109 if (!isAccessSuper(env.enclMethod))
2108 sym = binaryQualifier(sym, env.enclClass.type); 2110 sym = binaryQualifier(sym, env.enclClass.type);
2109 result = items.makeStaticItem(sym); 2111 result = items.makeStaticItem(sym);
2110 } else { 2112 } else {
2150 genNullCheck(tree.selected.pos()); 2152 genNullCheck(tree.selected.pos());
2151 } 2153 }
2152 result = items. 2154 result = items.
2153 makeImmediateItem(sym.type, ((VarSymbol) sym).getConstValue()); 2155 makeImmediateItem(sym.type, ((VarSymbol) sym).getConstValue());
2154 } else { 2156 } else {
2155 if (!accessSuper) 2157 if (isInvokeDynamic(sym)) {
2158 result = items.makeDynamicItem(sym);
2159 return;
2160 } else if (!accessSuper) {
2156 sym = binaryQualifier(sym, tree.selected.type); 2161 sym = binaryQualifier(sym, tree.selected.type);
2162 }
2157 if ((sym.flags() & STATIC) != 0) { 2163 if ((sym.flags() & STATIC) != 0) {
2158 if (!selectSuper && (ssym == null || ssym.kind != TYP)) 2164 if (!selectSuper && (ssym == null || ssym.kind != TYP))
2159 base = base.load(); 2165 base = base.load();
2160 base.drop(); 2166 base.drop();
2161 result = items.makeStaticItem(sym); 2167 result = items.makeStaticItem(sym);
2170 (sym.flags() & PRIVATE) != 0 || 2176 (sym.flags() & PRIVATE) != 0 ||
2171 selectSuper || accessSuper); 2177 selectSuper || accessSuper);
2172 } 2178 }
2173 } 2179 }
2174 } 2180 }
2181 }
2182
2183 public boolean isInvokeDynamic(Symbol sym) {
2184 return sym.kind == MTH && ((MethodSymbol)sym).isDynamic();
2175 } 2185 }
2176 2186
2177 public void visitLiteral(JCLiteral tree) { 2187 public void visitLiteral(JCLiteral tree) {
2178 if (tree.type.tag == TypeTags.BOT) { 2188 if (tree.type.tag == TypeTags.BOT) {
2179 code.emitop0(aconst_null); 2189 code.emitop0(aconst_null);

mercurial