Created
June 21, 2009 03:28
-
-
Save chanwit/133382 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hello.groovy | |
package g7.tests.classgen | |
class Hello{ | |
static void main(args) { | |
println "hello" | |
} | |
} | |
-- Run | |
$ java -cp ".;./target/classes" -Xint -XX:+EnableInvokeDynamic g7.tests.classgen.Hello | |
hello | |
-- Disassembled | |
$ javap -classpath . -c g7.tests.classgen.Hello | |
Compiled from "Hello.groovy" | |
public class g7.tests.classgen.Hello extends java.lang.Object { | |
static {}; | |
Code: | |
0: ldc #9; //String g7.tests.classgen.Hello | |
2: invokestatic #15; //Method java/lang/Class.forName:(Ljava/lang/String;)Ljava/lang/Class; | |
5: invokestatic #21; //Method com/chanwit/g7/runtime/G7Bootstrap.registerBootstrap:(Ljava/lang/Class;)V | |
8: return | |
public static void main(java.lang.String[]); | |
Code: | |
0: aconst_null | |
1: ldc #25; //String hello | |
3: invokedynamic #28, 0; //NameAndType println:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; | |
8: pop | |
9: return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment