Hi frederik, Tobias Ivarsson a écrit : > On Tue, May 5, 2009 at 5:15 PM, Fredrik Öhrström > <fredrik.ohrst...@oracle.com <mailto:fredrik.ohrst...@oracle.com>> wrote: > > What is the purpose of being able to invoke the constructor > through a MethodHandle? >
In my opinion: avoid late binding. > The reason I am asking is because > to me, it seems like we cannot perform a new through > a MethodHandle. Which means that we have to generate a > factory method (to which we can bind a MethodHandle) to > create a new instance and then we can just as well put > the call to the constructor there. Or am i missing > something? :-) > > > Isn't findSpecial just using the same semantics as invokespecial? > i.e. invoking/finding the method on the exact class instead of doing a > virtual dispatch. That is used for other things than only > constructors, in Java this is used for super.method(..)-invocations. or invocation of private methods, see section 7.7 of the JVM spec. > > /Tobias Rémi _______________________________________________ mlvm-dev mailing list mlvm-dev@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev