- public static Class compile(Seekable data) throws IOException, Compiler.Exn {
- String className = "nextedvm.runtimecompiled_" + uniqueID();
- System.err.println("RuntimeCompiler: Building " + className);
+ public static Class compile(Seekable data, String extraoptions, String sourceName) throws IOException, Compiler.Exn {
+ String className = "nestedvm.runtimecompiled";
+ byte[] bytecode;
+ try {
+ bytecode = runCompiler(data,className,extraoptions,sourceName,null);
+ } catch(Compiler.Exn e) {
+ if(e.getMessage() != null || e.getMessage().indexOf("constant pool full") != -1)
+ bytecode = runCompiler(data,className,extraoptions,sourceName,"lessconstants");
+ else
+ throw e;
+ }
+ return new SingleClassLoader().fromBytes(className,bytecode);
+ }
+
+ private static byte[] runCompiler(Seekable data, String name, String options, String sourceName, String moreOptions) throws IOException, Compiler.Exn {