diff -r 825f23a4f262 -r e2722bd43f3a src/share/classes/com/sun/tools/javac/jvm/Gen.java --- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java Thu Apr 16 11:23:02 2009 -0700 +++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java Mon May 04 21:04:04 2009 -0700 @@ -119,6 +119,7 @@ : options.get("-g:vars") != null; genCrt = options.get("-Xjcov") != null; debugCode = options.get("debugcode") != null; + allowInvokedynamic = options.get("invokedynamic") != null; generateIproxies = target.requiresIproxy() || @@ -155,6 +156,7 @@ private final boolean varDebugInfo; private final boolean genCrt; private final boolean debugCode; + private final boolean allowInvokedynamic; /** Default limit of (approximate) size of finalizer to inline. * Zero means always use jsr. 100 or greater means never use @@ -2140,6 +2142,9 @@ } result = items. makeImmediateItem(sym.type, ((VarSymbol) sym).getConstValue()); + } else if (allowInvokedynamic && sym.kind == MTH && ssym == syms.invokeDynamicType.tsym) { + base.drop(); + result = items.makeDynamicItem(sym); } else { if (!accessSuper) sym = binaryQualifier(sym, tree.selected.type);