Single stepping bytecodes inside eclipse

2018-04-04 Thread Ioi Lam
Hi, I am trying to trace into the method handle linking code. I have a program like this:     // HelloHM.java:8    mh.invokeExact("yo!");     23:    aload_3;     24:    ldc    #9; //    String "yo!";     26:    invokevirtual    #10; //    Method java/lang/invoke/MethodHandle.invokeExact:"

Why is "checkcast MethodHandle" necessary in methodHandleInvokeLinkerMethod?

2018-04-09 Thread Ioi Lam
I am looking at the code generated by MethodHandleNatives.linkMethod: (note the output was edited for brevity) $ cat HelloMH.java import java.lang.invoke.*; public class HelloMH {     public static void main(String ...args) throws Throwable {     MethodHandles.Lookup lookup = MethodHandles.

Re: Why is "checkcast MethodHandle" necessary in methodHandleInvokeLinkerMethod?

2018-04-09 Thread Ioi Lam
Object, hence making a checkcast necessary to cast it to a MethodHandle. HTH, Attila. On 2018. Apr 9., at 21:49, Ioi Lam wrote: I am looking at the code generated by MethodHandleNatives.linkMethod: (note the output was edited for brevity) $ cat HelloMH.java import java.lang.invoke

Re: Why is "checkcast MethodHandle" necessary in methodHandleInvokeLinkerMethod?

2018-04-09 Thread Ioi Lam
(int loops, MethodHandle mh) throws Throwable {     for (int i=0; iOn Apr 9, 2018, at 1:17 PM, Ioi Lam <mailto:[email protected]>> wrote: So why is this first argument not declared as a MethodHandle? The short answer is to simplify the plumbing of lambda forms. Method handles are

ResolvedMethodName::vmholder unused?

2018-05-07 Thread Ioi Lam
I don't see anywhere in HotSpot that uses java_lang_invoke_ResolvedMethodName::_vmholder_offset, which is declared here: http://hg.openjdk.java.net/jdk/jdk/file/7444101401b2/src/hotspot/share/classfile/javaClasses.hpp#l1057 http://hg.openjdk.java.net/jdk/jdk/file/9608f7f41c4e/src/java.base/shar

Re: ResolvedMethodName::vmholder unused?

2018-05-07 Thread Ioi Lam
l tracked by GC and keeps the metadata it accompanies (RMN::vmtarget) alive until RMN is reachable. Best regards, Vladimir Ivanov On 5/7/18 17:29, Ioi Lam wrote: I don't see anywhere in HotSpot that uses java_lang_invoke_ResolvedMethodName::_vmholder_offset, which is declared here: http:/