Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 1.42 KB | None | 0 0
  1.       boolean verbose = !true;
  2.       InterpreterContext.setup(new DefaultInterpreterFeedback(verbose));
  3.  
  4.       File classPath = new File("R:/workspace/Components/bin/");
  5.  
  6.       InterpreterProcess process = new InterpreterProcess(64 * 1024);
  7.  
  8.       // we need java.lang.Object and java.lang.Error
  9.  
  10.       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}");
  11.  
  12.       CompileHelper.compileAssembler(process, "public class java/lang/Error  {\n  public <init>()V\n    RETURN\n\n    MAXSTACK = 1\n    MAXLOCALS = 1\n}\n");
  13.  
  14.  
  15.       CompileHelper.compileBytecode(process, classPath, FibonaciTest.class);
  16.       CompileHelper.compileBytecode(process, classPath, ByteArrayTest.class);
  17.       CompileHelper.compileBytecode(process, classPath, ParameterTest.class);
  18.       CompileHelper.compileBytecode(process, classPath, Sys.class);
  19.  
  20.       // instead of calling interpreted methods on Sys.class, call Java methods
  21.       InterpreterBridge.bridgeAllMethods(process.lookupClass(Sys.class), Sys.class);
  22.  
  23.       // resolve all compiled methods and fields
  24.       process.link();
  25.  
  26.       //
  27.       process.executeClassStaticBlocks(64 /* max stack depth */);
  28.  
  29.       System.out.println("---------------------- end of static init blocks");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement