Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boolean verbose = !true;
- InterpreterContext.setup(new DefaultInterpreterFeedback(verbose));
- File classPath = new File("R:/workspace/Components/bin/");
- InterpreterProcess process = new InterpreterProcess(64 * 1024);
- // we need java.lang.Object and java.lang.Error
- CompileHelper.compileAssembler(process, "public class java/lang/Object {\n public <init>()V\n RETURN\n\n MAXSTACK = 1\n MAXLOCALS = 1\n\n public toString()Ljava/lang/String;\n L0\n ACONST_NULL\n ARETURN\n L1\n MAXSTACK = 1\n MAXLOCALS = 1\n}");
- CompileHelper.compileAssembler(process, "public class java/lang/Error {\n public <init>()V\n RETURN\n\n MAXSTACK = 1\n MAXLOCALS = 1\n}\n");
- CompileHelper.compileBytecode(process, classPath, FibonaciTest.class);
- CompileHelper.compileBytecode(process, classPath, ByteArrayTest.class);
- CompileHelper.compileBytecode(process, classPath, ParameterTest.class);
- CompileHelper.compileBytecode(process, classPath, Sys.class);
- // instead of calling interpreted methods on Sys.class, call Java methods
- InterpreterBridge.bridgeAllMethods(process.lookupClass(Sys.class), Sys.class);
- // resolve all compiled methods and fields
- process.link();
- //
- process.executeClassStaticBlocks(64 /* max stack depth */);
- System.out.println("---------------------- end of static init blocks");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement