diff -r fee2fbaf3293 -r 8a0ad9757002 jdk/src/share/classes/sun/dyn/Invokers.java --- a/jdk/src/share/classes/sun/dyn/Invokers.java Tue Sep 14 01:42:03 2010 -0700 +++ b/jdk/src/share/classes/sun/dyn/Invokers.java Sat Oct 30 21:02:30 2010 -0700 @@ -38,6 +38,10 @@ // exact invoker for the outgoing call private /*lazy*/ MethodHandle exactInvoker; + // erased (partially untyped but with primitives) invoker for the outgoing call + private /*lazy*/ MethodHandle erasedInvoker; + /*lazy*/ MethodHandle erasedInvokerWithDrops; // for InvokeGeneric + // generic (untyped) invoker for the outgoing call private /*lazy*/ MethodHandle genericInvoker; @@ -80,6 +84,19 @@ return invoker; } + public MethodHandle erasedInvoker() { + MethodHandle invoker1 = exactInvoker(); + MethodHandle invoker = erasedInvoker; + if (invoker != null) return invoker; + MethodType erasedType = targetType.erase(); + if (erasedType == targetType.generic()) + invoker = genericInvoker(); + else + invoker = MethodHandles.convertArguments(invoker1, invokerType(erasedType)); + erasedInvoker = invoker; + return invoker; + } + public MethodHandle varargsInvoker(int objectArgCount) { MethodHandle vaInvoker = varargsInvokers[objectArgCount]; if (vaInvoker != null) return vaInvoker;