- public static Class compile(Seekable data, String extraoptions) throws IOException, Compiler.Exn {
- int id;
- synchronized(RuntimeCompiler.class) {
- if(nextID == 32 || singleClassLoader == null) {
- singleClassLoader = new SingleClassLoader();
- nextID = 0;
- }
- id = nextID++;
+ public static Class compile(Seekable data, String extraoptions) throws IOException, Compiler.Exn { return compile(data,extraoptions,null); }
+
+ 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;