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:"
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.
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
(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
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
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:/