findVirtual problem

2009-08-18 Thread Christian Thalinger
Hi! Looks like there is a problem with findVirtual. Since I don't know very much about the MethodHandle Java level, I want to be sure it's not my fault. Doing: MethodHandle mh = MethodHandles.lookup().findVirtual(Object.class, toString, MethodType.make(String.class)); String result =

Re: findVirtual problem

2009-08-18 Thread Attila Szegedi
Shouldn't that be mh.String,Objectinvoke(foo) ? It returns a String and takes an Object. Attila. On 2009.08.18., at 10:55, Christian Thalinger wrote: MethodHandle mh = MethodHandles.lookup().findVirtual(Object.class, toString, MethodType.make(String.class)); String result =

Re: findVirtual problem

2009-08-18 Thread Christian Thalinger
Attila Szegedi wrote: Shouldn't that be mh.String,Objectinvoke(foo) ? It returns a String and takes an Object. No, the syntax is correct. A MethodHandle invoke only specifies the return type. -- Christian ___ mlvm-dev mailing list

Re: findVirtual problem

2009-08-18 Thread Raffaello Giulietti
Christian Thalinger wrote: Attila Szegedi wrote: Shouldn't that be mh.String,Objectinvoke(foo) ? It returns a String and takes an Object. No, the syntax is correct. A MethodHandle invoke only specifies the return type. -- Christian ___

Throwable

2009-08-18 Thread Raffaello Giulietti
The language compiler complains about an unreported exception Throwable; must be caught or declared to be thrown in using both InvokeDynamic and the (invisible) MethodHandle.invoke() Why is this so? What about an (unchecked) RuntimeException instead?

Inlining

2009-08-18 Thread Raffaello Giulietti
* Is there a special -XX: flag to turn on inlining of methods invoked via method handles? * Or must something be enabled during the build of mlvm? Thanks Raffaello ___ mlvm-dev mailing list mlvm-dev@openjdk.java.net

Re: Inlining

2009-08-18 Thread Christian Thalinger
Raffaello Giulietti wrote: * Is there a special -XX: flag to turn on inlining of methods invoked via method handles? * Or must something be enabled during the build of mlvm? No, inlining is enabled by default. Currently only DMH invokes are inlined, but I'm working on inlining the rest. Are

Re: Throwable

2009-08-18 Thread Charles Oliver Nutter
On Tue, Aug 18, 2009 at 6:29 AM, Raffaello Giuliettiraffaello.giulie...@gmail.com wrote: The language compiler complains about an unreported exception Throwable; must be caught or declared to be thrown in using both InvokeDynamic and the (invisible) MethodHandle.invoke() Why is this so? What

Re: findVirtual problem

2009-08-18 Thread John Rose
On Aug 18, 2009, at 6:07 AM, Raffaello Giulietti wrote: Hi Christian, do an upcast String result = mh.Stringinvoke((Object) foo); Yes. The difference between the two call sites is: (Ljava/lang/String;)Ljava/lang/String; vs. (Ljava/lang/Object;)Ljava/lang/String; The actual (erased)