Details
-
Bug
-
Resolution: Fixed
-
P2
-
8, 8-repo-lambda
-
b84
-
Verified
Description
Example 2
Source:
public class InstanceLambda {
public void m() {
Runnable r = ()->m();
}
}
---
javap of javac output (Lambda b76):
Classfile /Users/dan/Dev/misc/classes/InstanceLambda.class
...
BootstrapMethods:
0: #16 invokestatic java/lang/invoke/LambdaMetafactory.metaFactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
Method arguments:
#17 invokeinterface java/lang/Runnable.run:()V
#18 invokevirtual InstanceLambda.lambda$0:()V [***** Note invocation mode: invokevirtual *****]
#19 ()V
{
...
public void m();
flags: ACC_PUBLIC
Code:
stack=1, locals=2, args_size=1
0: aload_0
1: invokedynamic #2, 0 // InvokeDynamic #0:lambda$:(LInstanceLambda;)Ljava/lang/Runnable;
6: astore_1
7: return
...
private void lambda$0();
flags: ACC_PRIVATE, ACC_SYNTHETIC [***** Note access: private *****]
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokevirtual #3 // Method m:()V
4: return
...
}
Source:
public class InstanceLambda {
public void m() {
Runnable r = ()->m();
}
}
---
javap of javac output (Lambda b76):
Classfile /Users/dan/Dev/misc/classes/InstanceLambda.class
...
BootstrapMethods:
0: #16 invokestatic java/lang/invoke/LambdaMetafactory.metaFactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
Method arguments:
#17 invokeinterface java/lang/Runnable.run:()V
#18 invokevirtual InstanceLambda.lambda$0:()V [***** Note invocation mode: invokevirtual *****]
#19 ()V
{
...
public void m();
flags: ACC_PUBLIC
Code:
stack=1, locals=2, args_size=1
0: aload_0
1: invokedynamic #2, 0 // InvokeDynamic #0:lambda$:(LInstanceLambda;)Ljava/lang/Runnable;
6: astore_1
7: return
...
private void lambda$0();
flags: ACC_PRIVATE, ACC_SYNTHETIC [***** Note access: private *****]
Code:
stack=1, locals=1, args_size=1
0: aload_0
1: invokevirtual #3 // Method m:()V
4: return
...
}