diff --git a/packages/java-runtime/src/fs.ts b/packages/java-runtime/src/fs.ts index 08148f01..cab184f3 100644 --- a/packages/java-runtime/src/fs.ts +++ b/packages/java-runtime/src/fs.ts @@ -1,4 +1,5 @@ import BrowserFS from 'browserfs'; +import type ZipFS from 'browserfs/dist/node/backend/ZipFS'; import type { FSModule } from 'browserfs/dist/node/core/FS'; export { FSModule }; @@ -35,35 +36,27 @@ function recursiveCopy(srcFolder: string, destFolder: string) { processDir(srcFolder, destFolder); } +// Seeds an in-memory filesystem out of the doppio.zip artifact: +// `classes/` (doppio's own classes) and `vendor/` (JCL jars). The ZipFS +// mount is used only as a transient extraction source and is unmounted +// right after, so neither the zip buffer nor its index outlive init. export async function initFs(libZipData: ArrayBuffer): Promise { - await new Promise((resolve, reject) => - BrowserFS.configure( - { - fs: 'MountableFileSystem', - options: { - '/tmp': { - fs: 'InMemory', - options: {} - }, - '/home': { - fs: 'InMemory', - options: {} - }, - '/zip': { - fs: 'ZipFS', - options: { - zipData: Buffer.from(libZipData) - } - }, - '/sys': { - fs: 'InMemory', - options: {} - } - } - }, - (e) => (e ? reject(e) : resolve()) + const zipFs = await new Promise((resolve, reject) => + BrowserFS.FileSystem.ZipFS.Create({ zipData: Buffer.from(libZipData) }, (e, created) => + e ? reject(e) : resolve(created!) ) ); - recursiveCopy('/zip', '/sys'); + const mfs = new BrowserFS.FileSystem.MountableFileSystem(); + mfs.mount('/tmp', new BrowserFS.FileSystem.InMemory()); + mfs.mount('/home', new BrowserFS.FileSystem.InMemory()); + mfs.mount('/sys', new BrowserFS.FileSystem.InMemory()); + mfs.mount('/zip', zipFs); + BrowserFS.initialize(mfs); + try { + recursiveCopy('/zip/classes', '/sys/classes'); + recursiveCopy('/zip/vendor', '/sys/vendor'); + } finally { + mfs.umount('/zip'); + } return fs; } diff --git a/packages/java-runtime/src/java-compiler.ts b/packages/java-runtime/src/java-compiler.ts index c7ea31d2..b9ee1787 100644 --- a/packages/java-runtime/src/java-compiler.ts +++ b/packages/java-runtime/src/java-compiler.ts @@ -1,28 +1,40 @@ import type { File } from 'libs/compiler'; -import { Context, withCancel } from 'libs/context'; +import { inContext, withCancel, type Context } from 'libs/context'; import { FSModule } from './fs'; import { JVMFactory } from './jvm-factory'; export class JavaCompiler { + private lastSourcesKey: string | null = null; + constructor( protected readonly jvmFactory: JVMFactory, protected readonly fs: FSModule ) {} + // Skips javac entirely when the sources are unchanged since the last + // successful compilation and compiled classes are still present. async compile(ctx: Context, files: File[]) { + const key = files.map((file) => `${file.filename}\u0000${file.content}`).join('\u0001'); + if (key === this.lastSourcesKey && this.hasClasses()) { + return; + } const paths = files.map((file) => this.writeFile(file)); + // The JVM is single-use: cancel its context when done so the + // factory disposes its stdio wiring, otherwise output leaks + // into subsequent runs. const [jvmCtx, cancel] = withCancel(ctx); const jvm = await this.jvmFactory(jvmCtx); - return new Promise((resolve, reject) => { - jvm.runClass('util.Javac', paths, (code) => { - if (code === 0) { - resolve(); - } else { - reject(new Error('Compilation failed')); - } - }); - }).finally(cancel); + const code = await inContext( + jvmCtx, + new Promise((resolve) => { + jvm.runClass('util.Javac', paths, resolve); + }) + ).finally(cancel); + if (code !== 0) { + throw new Error('Compilation failed'); + } + this.lastSourcesKey = key; } protected writeFile(file: File): string { @@ -31,4 +43,12 @@ export class JavaCompiler { this.fs.writeFileSync(path, file.content); return path; } + + private hasClasses(): boolean { + try { + return this.fs.readdirSync('/home').some((name) => name.endsWith('.class')); + } catch { + return false; + } + } } diff --git a/patches/doppiojvm@0.5.0.patch b/patches/doppiojvm@0.5.0.patch index 13d994ca..4f6c57d3 100644 --- a/patches/doppiojvm@0.5.0.patch +++ b/patches/doppiojvm@0.5.0.patch @@ -1,5 +1,5 @@ diff --git a/dist/release/doppio.js b/dist/release/doppio.js -index e436cb87febf01acade8c117365fb458ba27b5ff..76bfe7c3accbc24f40c41998e0acc4d6fb559b44 100644 +index e436cb87febf01acade8c117365fb458ba27b5ff..ec5f59287bd0428b9e12b39460b754ed037dedad 100644 --- a/dist/release/doppio.js +++ b/dist/release/doppio.js @@ -4,7 +4,7 @@ return"SourceFile"},t.parse=function(t,e){return new this(e.get(t.getUint16()).v @@ -7,7 +7,7 @@ index e436cb87febf01acade8c117365fb458ba27b5ff..76bfe7c3accbc24f40c41998e0acc4d6 emit:function(t,e,n,r,o,i,s){var l=a(s,i);return"\nif(!u.isNull(t,f,"+t[2]+")){\nvar len"+n+"="+t[2]+".array.length;\nif("+t[1]+"<0||"+t[1]+">=len"+n+"){\n"+l+"\nu.throwException(t,f,'Ljava/lang/ArrayIndexOutOfBoundsException;',\"\"+"+t[1]+'+" not in length "+len'+n+'+" array of type "+'+t[2]+".getClass().getInternalName());\n}else{"+t[2]+".array["+t[1]+"]="+t[0]+";"+r+"}\n}else{"+l+"}"}};t[r.OpCode.IASTORE]=b,t[r.OpCode.FASTORE]=b,t[r.OpCode.AASTORE]=b,t[r.OpCode.BASTORE]=b,t[r.OpCode.CASTORE]=b,t[r.OpCode.SASTORE]=b;var A={hasBranch:!1,pops:4,pushes:0,emit:function(t,e,n,r,o,i,s){var l=a(s,i);return"\nif(!u.isNull(t,f,"+t[3]+")){\nvar len"+n+"="+t[3]+".array.length;\nif("+t[2]+"<0||"+t[2]+">=len"+n+"){\n"+l+"\nu.throwException(t,f,'Ljava/lang/ArrayIndexOutOfBoundsException;',\"\"+"+t[2]+'+" not in length "+len'+n+'+" array of type "+'+t[3]+".getClass().getInternalName());\n}else{"+t[3]+".array["+t[2]+"]="+t[1]+";"+r+"}\n}else{"+l+"}"}};t[r.OpCode.DASTORE]=A,t[r.OpCode.LASTORE]=A,t[r.OpCode.LDC]={hasBranch:!1,pops:0,pushes:1,emit:function(t,e,n,r,o,i,s){var l=o[i+1],u=a(s,i);return"\nvar cnst"+n+"=f.method.cls.constantPool.get("+l+");\nif(cnst"+n+".isResolved()){var "+e[0]+"=cnst"+n+".getConstant(t);"+r+"\n}else{"+u+"u.resolveCPItem(t,f,cnst"+n+");}"}},t[r.OpCode.LDC_W]={hasBranch:!1,pops:0,pushes:1,emit:function(t,e,n,r,o,i,s){var l=o.readUInt16BE(i+1),u=a(s,i);return"\nvar cnst"+n+"=f.method.cls.constantPool.get("+l+");\nif(cnst"+n+".isResolved()){var "+e[0]+"=cnst"+n+".getConstant(t);"+r+"\n}else{"+u+"u.resolveCPItem(t,f,cnst"+n+");}"}},t[r.OpCode.LDC2_W]={hasBranch:!1,pops:0,pushes:2,emit:function(t,e,n,a,r,o){var i=r.readUInt16BE(o+1);return"var "+e[0]+"=f.method.cls.constantPool.get("+i+").value,"+e[1]+"=null;"+a}},t[r.OpCode.GETSTATIC_FAST32]={hasBranch:!1,pops:0,pushes:1,emit:function(t,e,n,a,r,o){var i=r.readUInt16BE(o+1);return"var fi"+n+"=f.method.cls.constantPool.get("+i+"),"+e[0]+"=fi"+n+".fieldOwnerConstructor[fi"+n+".fullFieldName];"+a}},t[r.OpCode.GETSTATIC_FAST64]={hasBranch:!1,pops:0,pushes:2,emit:function(t,e,n,a,r,o){var i=r.readUInt16BE(o+1);return"\nvar fi"+n+"=f.method.cls.constantPool.get("+i+"),"+e[0]+"=fi"+n+".fieldOwnerConstructor[fi"+n+".fullFieldName],\n"+e[1]+"=null;"+a}},t[r.OpCode.GETFIELD_FAST32]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,r,o,s,l,u){var c=a(l,s),p=o.readUInt16BE(s+1),f=u.cls.constantPool.get(p),h=f.fullFieldName.replace(i,"\\\\");return"if(!u.isNull(t,f,"+t[0]+")){var "+e[0]+"="+t[0]+"['"+h+"'];"+r+"}else{"+c+"}"}},t[r.OpCode.GETFIELD_FAST64]={hasBranch:!1,pops:1,pushes:2,emit:function(t,e,n,r,o,s,l,u){var c=a(l,s),p=o.readUInt16BE(s+1),f=u.cls.constantPool.get(p),h=f.fullFieldName.replace(i,"\\\\");return"if(!u.isNull(t,f,"+t[0]+")){var "+e[0]+"="+t[0]+"['"+h+"'],"+e[1]+"=null;"+r+"}else{"+c+"}"}},t[r.OpCode.PUTFIELD_FAST32]={hasBranch:!1,pops:2,pushes:0,emit:function(t,e,n,r,o,s,l,u){var c=a(l,s),p=o.readUInt16BE(s+1),f=u.cls.constantPool.get(p),h=f.fullFieldName.replace(i,"\\\\");return"if(!u.isNull(t,f,"+t[1]+")){"+t[1]+"['"+h+"']="+t[0]+";"+r+"}else{"+c+"}"}},t[r.OpCode.PUTFIELD_FAST64]={hasBranch:!1,pops:3,pushes:0,emit:function(t,e,n,r,o,s,l,u){var c=a(l,s),p=o.readUInt16BE(s+1),f=u.cls.constantPool.get(p),h=f.fullFieldName.replace(i,"\\\\");return"if(!u.isNull(t,f,"+t[2]+")){"+t[2]+"['"+h+"']="+t[1]+";"+r+"}else{"+c+"}"}},t[r.OpCode.INSTANCEOF_FAST]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,a,r,o){var i=r.readUInt16BE(o+1);return"var cls"+n+"=f.method.cls.constantPool.get("+i+").cls,"+e[0]+"="+t[0]+"!==null?("+t[0]+".getClass().isCastable(cls"+n+")?1:0):0;"+a}},t[r.OpCode.CHECKCAST_FAST]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,a,r,o,i,s){var l=r.readUInt16BE(o+1),u=s.cls.constantPool.get(l),c=u.cls.getExternalName();return"var cls"+n+"=f.method.cls.constantPool.get("+l+").cls;\nif(("+t[0]+"!=null)&&!"+t[0]+".getClass().isCastable(cls"+n+")){\nu.throwException(t,f,'Ljava/lang/ClassCastException;',"+t[0]+".getClass().getExternalName()+' cannot be cast to "+c+"');\n}else{var "+e[0]+"="+t[0]+";"+a+"}"}},t[r.OpCode.ARRAYLENGTH]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,r,o,i,s){var l=a(s,i);return"if(!u.isNull(t,f,"+t[0]+")){var "+e[0]+"="+t[0]+".array.length;"+r+"}else{"+l+"}"}};var w={hasBranch:!1,pops:0,pushes:1,emit:function(t,e,n,a,r,o){var i=r[o+1];return"var "+e[0]+"=f.locals["+i+"];"+a}};t[r.OpCode.ILOAD]=w,t[r.OpCode.ALOAD]=w,t[r.OpCode.FLOAD]=w;var j={hasBranch:!1,pops:0,pushes:2,emit:function(t,e,n,a,r,o){var i=r[o+1];return"var "+e[0]+"=f.locals["+i+"],"+e[1]+"=null;"+a}};t[r.OpCode.LLOAD]=j,t[r.OpCode.DLOAD]=j;var O={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,a,r,o){var i=r[o+1];return"f.locals["+i+"]="+t[0]+";"+a}};t[r.OpCode.ISTORE]=O,t[r.OpCode.ASTORE]=O,t[r.OpCode.FSTORE]=O,t[r.OpCode.BIPUSH]={hasBranch:!1,pops:0,pushes:1,emit:function(t,e,n,a,r,o){var i=r.readInt8(o+1);return"var "+e[0]+"="+i+";"+a}},t[r.OpCode.SIPUSH]={hasBranch:!1,pops:0,pushes:1,emit:function(t,e,n,a,r,o){var i=r.readInt16BE(o+1);return"var "+e[0]+"="+i+";"+a}},t[r.OpCode.IINC]={hasBranch:!1,pops:0,pushes:0,emit:function(t,e,n,a,r,o){var i=r[o+1],s=r.readInt8(o+2);return"f.locals["+i+"]=(f.locals["+i+"]+"+s+")|0;"+a}},t[r.OpCode.ATHROW]={hasBranch:!0,pops:1,pushes:0,emit:function(t,e,n,r,o,i,s){var l=a(s,i);return l+"t.throwException("+t[0]+");f.returnToThreadLoop=true;"}},t[r.OpCode.GOTO]={hasBranch:!0,pops:0,pushes:0,emit:function(t,e,n,a,r,o){var i=r.readInt16BE(o+1);return"f.pc="+(o+i)+";"+a}},t[r.OpCode.TABLESWITCH]={hasBranch:!0,pops:1,pushes:0,emit:function(t,e,n,a,r,o){var i=o+(4-(o+1)%4)%4+1,s=r.readInt32BE(i),l=r.readInt32BE(i+4),u=r.readInt32BE(i+8);if(u-l<8){for(var c="switch("+t[0]+"){",p=l;p<=u;p++){var f=r.readInt32BE(i+12+4*(p-l));c+="case "+p+":f.pc="+(o+f)+";break;"}return c+="default:f.pc="+(o+s)+"}"+a}return"if("+t[0]+">="+l+"&&"+t[0]+"<="+u+"){f.pc="+o+"+f.method.getCodeAttribute().getCode().readInt32BE("+(i+12)+"+(("+t[0]+" - "+l+")*4))}else{f.pc="+(o+s)+"}"+a}};var k={hasBranch:!1,pops:2,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[0]+"==="+t[1]+"){"+u+"}else{"+r+"}"}};t[r.OpCode.IF_ICMPEQ]=k,t[r.OpCode.IF_ACMPEQ]=k;var F={hasBranch:!1,pops:2,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[0]+"!=="+t[1]+"){"+u+"}else{"+r+"}"}};t[r.OpCode.IF_ICMPNE]=F,t[r.OpCode.IF_ACMPNE]=F,t[r.OpCode.IF_ICMPGE]={hasBranch:!1,pops:2,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[1]+">="+t[0]+"){"+u+"}else{"+r+"}"}},t[r.OpCode.IF_ICMPGT]={hasBranch:!1,pops:2,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[1]+">"+t[0]+"){"+u+"}else{"+r+"}"}},t[r.OpCode.IF_ICMPLE]={hasBranch:!1,pops:2,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[1]+"<="+t[0]+"){"+u+"}else{"+r+"}"}},t[r.OpCode.IF_ICMPLT]={hasBranch:!1,pops:2,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[1]+"<"+t[0]+"){"+u+"}else{"+r+"}"}},t[r.OpCode.IFNULL]={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[0]+"==null){"+u+"}else{"+r+"}"}},t[r.OpCode.IFNONNULL]={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[0]+"!=null){"+u+"}else{"+r+"}"}},t[r.OpCode.IFEQ]={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[0]+"===0){"+u+"}else{"+r+"}"}},t[r.OpCode.IFNE]={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[0]+"!==0){"+u+"}else{"+r+"}"}},t[r.OpCode.IFGT]={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[0]+">0){"+u+"}else{"+r+"}"}},t[r.OpCode.IFLT]={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[0]+"<0){"+u+"}else{"+r+"}"}},t[r.OpCode.IFGE]={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[0]+">=0){"+u+"}else{"+r+"}"}},t[r.OpCode.IFLE]={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,r,o,i,s){var l=o.readInt16BE(i+1),u=a(s,i+l);return"if("+t[0]+"<=0){"+u+"}else{"+r+"}"}},t[r.OpCode.LCMP]={hasBranch:!1,pops:4,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[3]+".compare("+t[1]+");"+a}},t[r.OpCode.FCMPL]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[0]+"==="+t[1]+"?0:("+t[1]+">"+t[0]+"?1:-1);"+a}},t[r.OpCode.DCMPL]={hasBranch:!1,pops:4,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[3]+"==="+t[1]+"?0:("+t[3]+">"+t[1]+"?1:-1);"+a}},t[r.OpCode.FCMPG]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[0]+"==="+t[1]+"?0:("+t[1]+"<"+t[0]+"?-1:1);"+a}},t[r.OpCode.DCMPG]={hasBranch:!1,pops:4,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[3]+"==="+t[1]+"?0:("+t[3]+"<"+t[1]+"?-1:1);"+a}},t[r.OpCode.RETURN]={hasBranch:!0,pops:0,pushes:0,emit:function(t,e,n,a,r,o,i,s){return s.accessFlags.isSynchronized()?"f.pc="+o+";f.returnToThreadLoop=true;if(!f.method.methodLock(t,f).exit(t)){return}t.asyncReturn();":"f.pc="+o+";f.returnToThreadLoop=true;t.asyncReturn();"}};var R={hasBranch:!0,pops:1,pushes:0,emit:function(t,e,n,a,r,o,i,s){return s.accessFlags.isSynchronized()?"f.pc="+o+";f.returnToThreadLoop=true;if(!f.method.methodLock(t,f).exit(t)){return}t.asyncReturn("+t[0]+");":"f.pc="+o+";f.returnToThreadLoop=true;t.asyncReturn("+t[0]+");"}};t[r.OpCode.IRETURN]=R,t[r.OpCode.FRETURN]=R,t[r.OpCode.ARETURN]=R;var D={hasBranch:!0,pops:2,pushes:0,emit:function(t,e,n,a,r,o,i,s){return s.accessFlags.isSynchronized()?"f.pc="+o+";f.returnToThreadLoop=true;if(!f.method.methodLock(t,f).exit(t)){return}t.asyncReturn("+t[1]+",null);":"f.pc="+o+";f.returnToThreadLoop=true;t.asyncReturn("+t[1]+",null);"}};return t[r.OpCode.LRETURN]=D,t[r.OpCode.DRETURN]=D,t[r.OpCode.MONITOREXIT]={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,r,o,i,s){var l=a(s,i);return"if("+t[0]+".getMonitor().exit(t)){"+r+"}else{"+l+"f.returnToThreadLoop=true;}"}},t[r.OpCode.IXOR]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[0]+"^"+t[1]+";"+a}},t[r.OpCode.LXOR]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+".xor("+t[3]+"),"+e[1]+"=null;"+a}},t[r.OpCode.IOR]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[0]+"|"+t[1]+";"+a}},t[r.OpCode.LOR]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[3]+".or("+t[1]+"),"+e[1]+"=null;"+a}},t[r.OpCode.IAND]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[0]+"&"+t[1]+";"+a}},t[r.OpCode.LAND]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[3]+".and("+t[1]+"),"+e[1]+"=null;"+a}},t[r.OpCode.IADD]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=("+t[0]+"+"+t[1]+")|0;"+a}},t[r.OpCode.LADD]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+".add("+t[3]+"),"+e[1]+"=null;"+a}},t[r.OpCode.DADD]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+"+"+t[3]+","+e[1]+"=null;"+a}},t[r.OpCode.IMUL]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=Math.imul("+t[0]+", "+t[1]+");"+a}},t[r.OpCode.FMUL]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=u.wrapFloat("+t[0]+"*"+t[1]+");"+a}},t[r.OpCode.LMUL]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[3]+".multiply("+t[1]+"),"+e[1]+"= null;"+a}},t[r.OpCode.DMUL]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[3]+"*"+t[1]+","+e[1]+"=null;"+a}},t[r.OpCode.IDIV]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,r,o,i,s){var l=a(s,i);return"\nif("+t[0]+"===0){"+l+"u.throwException(t,f,'Ljava/lang/ArithmeticException;','/ by zero');\n}else{var "+e[0]+"=("+t[1]+"===u.Constants.INT_MIN&&"+t[0]+"===-1)?"+t[1]+":(("+t[1]+"/"+t[0]+")|0);"+r+"}"}},t[r.OpCode.LDIV]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,r,o,i,s){var l=a(s,i);return"\nif("+t[1]+".isZero()){"+l+"u.throwException(t,f,'Ljava/lang/ArithmeticException;','/ by zero');\n}else{var "+e[0]+"="+t[3]+".div("+t[1]+"),"+e[1]+"=null;"+r+"}"}},t[r.OpCode.DDIV]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[3]+"/"+t[1]+","+e[1]+"=null;"+a}},t[r.OpCode.ISUB]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=("+t[1]+"-"+t[0]+")|0;"+a}},t[r.OpCode.LSUB]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+".negate().add("+t[3]+"),"+e[1]+"= null;"+a}},t[r.OpCode.DSUB]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[3]+"-"+t[1]+","+e[1]+"=null;"+a}},t[r.OpCode.IREM]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,r,o,i,s){var l=a(s,i);return"if("+t[0]+"===0){"+l+"u.throwException(t,f,'Ljava/lang/ArithmeticException;','/ by zero');\n}else{var "+e[0]+"="+t[1]+"%"+t[0]+";"+r+"}"}},t[r.OpCode.LREM]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,r,o,i,s){var l=a(s,i);return"if("+t[1]+".isZero()){"+l+"u.throwException(t,f,'Ljava/lang/ArithmeticException;','/ by zero');\n}else{var "+e[0]+"="+t[3]+".modulo("+t[1]+"),"+e[1]+"=null;"+r+"}"}},t[r.OpCode.DREM]={hasBranch:!1,pops:4,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[3]+"%"+t[1]+","+e[1]+"=null;"+a}},t[r.OpCode.INEG]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=(-"+t[0]+")|0;"+a}},t[r.OpCode.LNEG]={hasBranch:!1,pops:2,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+".negate(),"+e[1]+"=null;"+a}},t[r.OpCode.ISHL]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+"<<"+t[0]+";"+a}},t[r.OpCode.LSHL]={hasBranch:!1,pops:3,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[2]+".shiftLeft(u.gLong.fromInt("+t[0]+")),"+e[1]+"=null;"+a}},t[r.OpCode.ISHR]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+">>"+t[0]+";"+a}},t[r.OpCode.LSHR]={hasBranch:!1,pops:3,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[2]+".shiftRight(u.gLong.fromInt("+t[0]+")),"+e[1]+"=null;"+a}},t[r.OpCode.IUSHR]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=("+t[1]+">>>"+t[0]+")|0;"+a}},t[r.OpCode.LUSHR]={hasBranch:!1,pops:3,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[2]+".shiftRightUnsigned(u.gLong.fromInt("+t[0]+")),"+e[1]+"=null;"+a}},t[r.OpCode.I2B]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=("+t[0]+"<<24)>>24;"+a}},t[r.OpCode.I2S]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=("+t[0]+"<<16)>>16;"+a}},t[r.OpCode.I2C]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[0]+"&0xFFFF;"+a}},t[r.OpCode.I2L]={hasBranch:!1,pops:1,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"=u.gLong.fromInt("+t[0]+"),"+e[1]+"=null;"+a}},t[r.OpCode.I2F]={hasBranch:!1,pops:0,pushes:0,emit:function(t,e,n,a){return""+a}},t[r.OpCode.I2D]={hasBranch:!1,pops:0,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=null;"+a}},t[r.OpCode.F2I]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=u.float2int("+t[0]+");"+a}},t[r.OpCode.F2D]={hasBranch:!1,pops:0,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=null;"+a}},t[r.OpCode.L2I]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+".toInt();"+a}},t[r.OpCode.L2D]={hasBranch:!1,pops:2,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+".toNumber(),"+e[1]+"=null;"+a}},t[r.OpCode.D2I]={hasBranch:!1,pops:2,pushes:1,emit:function(t,e,n,a){return"var "+e[0]+"=u.float2int("+t[1]+");"+a}},t[r.OpCode.DUP]={hasBranch:!1,pops:1,pushes:2,emit:function(t,e,n,a){return"var "+e[0]+"="+t[0]+","+e[1]+"="+t[0]+";"+a}},t[r.OpCode.DUP2]={hasBranch:!1,pops:2,pushes:4,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+","+e[1]+"="+t[0]+","+e[2]+"="+t[1]+","+e[3]+"="+t[0]+";"+a}},t[r.OpCode.DUP_X1]={hasBranch:!1,pops:2,pushes:3,emit:function(t,e,n,a){return"var "+e[0]+"="+t[0]+","+e[1]+"="+t[1]+","+e[2]+"="+t[0]+";"+a}},t[r.OpCode.DUP_X2]={hasBranch:!1,pops:3,pushes:4,emit:function(t,e,n,a){return"var "+e[0]+"="+t[0]+","+e[1]+"="+t[2]+","+e[2]+"="+t[1]+","+e[3]+"="+t[0]+";"+a}},t[r.OpCode.DUP2_X1]={hasBranch:!1,pops:3,pushes:5,emit:function(t,e,n,a){return"var "+e[0]+"="+t[1]+","+e[1]+"="+t[0]+","+e[2]+"="+t[2]+","+e[3]+"="+t[1]+","+e[4]+"="+t[0]+";"+a}},t[r.OpCode.NEW_FAST]={hasBranch:!1,pops:0,pushes:1,emit:function(t,e,n,a,r,o){var i=r.readUInt16BE(o+1);return"var cr"+n+"=f.method.cls.constantPool.get("+i+"),"+e[0]+"=(new cr"+n+".clsConstructor(t));"+a}},t[r.OpCode.NEWARRAY]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,r,i,s,l){var u=i[s+1],c="["+o.ArrayTypes[u],p=a(l,s);return"\nvar cls"+n+"=f.getLoader().getInitializedClass(t,'"+c+"');\nif("+t[0]+">=0){var "+e[0]+"=new (cls"+n+".getConstructor(t))(t,"+t[0]+");"+r+"\n}else{"+p+"u.throwException(t,f,'Ljava/lang/NegativeArraySizeException;','Tried to init "+c+" array with length '+"+t[0]+");}"}},t[r.OpCode.ANEWARRAY_FAST]={hasBranch:!1,pops:1,pushes:1,emit:function(t,e,n,r,i,s,l){var u=i.readUInt16BE(s+1),c=("["+o.ArrayTypes[u],a(l,s));return"\nvar cr"+n+"=f.method.cls.constantPool.get("+u+");\nif("+t[0]+">=0){var "+e[0]+"=new cr"+n+".arrayClassConstructor(t,"+t[0]+");"+r+"\n}else{"+c+"u.throwException(t,f,'Ljava/lang/NegativeArraySizeException;','Tried to init '+cr"+n+".arrayClass.getInternalName()+' array with length '+"+t[0]+");}"}},t[r.OpCode.NOP]={hasBranch:!1,pops:0,pushes:0,emit:function(t,e,n,a){return""+a}},t[r.OpCode.POP]={hasBranch:!1,pops:1,pushes:0,emit:function(t,e,n,a){return""+a}},t[r.OpCode.POP2]={hasBranch:!1,pops:2,pushes:0,emit:function(t,e,n,a){return""+a}},t}()},function(t,e,n){"use strict";var a=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},r=n(21),o=n(24),i=n(26),s=n(8),l=n(6),u=n(16),c=n(13),p=(u.debug,u.error),f=function(){function t(){this.locks={}}return t.prototype.tryLock=function(t,e,n){return void 0===this.locks[t]&&(this.locks[t]=new o["default"]),this.locks[t].tryLock(e,n)},t.prototype.unlock=function(t,e){this.locks[t].unlock(e),delete this.locks[t]},t.prototype.getOwner=function(t){return this.locks[t]?this.locks[t].getOwner():null},t}(),h=function(){function t(t){this.bootstrap=t,this.loadedClasses={},this.loadClassLocks=new f}return t.prototype.getLoadedClassNames=function(){return Object.keys(this.loadedClasses)},t.prototype.addClass=function(t,e){c["default"](null==this.loadedClasses[t]||this.loadedClasses[t]===e),this.loadedClasses[t]=e},t.prototype.getClass=function(t){return this.loadedClasses[t]},t.prototype.defineClass=function(t,e,n,a){try{var o=new r.ReferenceClassData(n,a,this);return this.addClass(e,o),o}catch(e){return null===t?(p("JVM initialization failed: "+e),p(e.stack)):t.throwNewException("Ljava/lang/ClassFormatError;",e),null}},t.prototype.defineArrayClass=function(t){c["default"](null!=this.getLoadedClass(l.get_component_type(t)));var e=new r.ArrayClassData(l.get_component_type(t),this);return this.addClass(t,e),e},t.prototype.getLoadedClass=function(t){var e=this.loadedClasses[t];if(null!=e)return e;if(l.is_primitive_type(t))return this.bootstrap.getPrimitiveClass(t);if(l.is_array_type(t)){var n=this.getLoadedClass(l.get_component_type(t));if(null!=n){var a=n.getLoader();return a===this?this.defineArrayClass(t):(e=a.getLoadedClass(t),this.addClass(t,e),e)}}return null},t.prototype.getResolvedClass=function(t){var e=this.getLoadedClass(t);return null!==e&&(e.isResolved()||e.tryToResolve())?e:null},t.prototype.getInitializedClass=function(t,e){var n=this.getLoadedClass(e);return null!==n?n.isInitialized(t)||n.tryToInitialize()?n:null:n},t.prototype.loadClass=function(t,e,n,a){var r=this;void 0===a&&(a=!0);var o=this.getLoadedClass(e);o?setImmediate(function(){n(o)}):this.loadClassLocks.tryLock(e,t,n)&&(l.is_reference_type(e)?this._loadClass(t,e,function(t){r.loadClassLocks.unlock(e,t)},a):this.loadClass(t,l.get_component_type(e),function(t){null!=t&&r.loadClassLocks.unlock(e,r.getLoadedClass(e))},a))},t.prototype.resolveClasses=function(t,e,n){var a=this,r={};l.asyncForEach(e,function(e,n){a.resolveClass(t,e,function(t){null===t?n("Error resolving class: "+e):(r[e]=t,n())})},function(t){n(t?null:r)})},t.prototype.resolveClass=function(t,e,n,a){void 0===a&&(a=!0),this.loadClass(t,e,function(e){null===e||e.isResolved()?setImmediate(function(){n(e)}):e.resolve(t,n,a)},a)},t.prototype.initializeClass=function(t,e,n,a){void 0===a&&(a=!0),this.resolveClass(t,e,function(r){null===r||r.isInitialized(t)?setImmediate(function(){n(r)}):(c["default"](l.is_reference_type(e)),r.initialize(t,n,a))},a)},t.prototype.throwClassNotFoundException=function(t,e,n){t.throwNewException(n?"Ljava/lang/ClassNotFoundException;":"Ljava/lang/NoClassDefFoundError;","Cannot load class: "+l.ext_classname(e))},t}();e.ClassLoader=h;var d=function(t){function e(e,n,a){var r=this;t.call(this,null),this.bootstrap=this,this.classpath=null,this.loadedPackages={},i.ClasspathFactory(e,n,function(t){r.classpath=t.reverse(),a()})}return a(e,t),e.prototype._registerLoadedClass=function(t,e){var n=t.slice(0,t.lastIndexOf("/")),a=this.loadedPackages[n];a?a[0]!==e&&a.indexOf(e)===-1&&a.push(e):this.loadedPackages[n]=[e]},e.prototype.getPackages=function(){var t=this;return Object.keys(this.loadedPackages).map(function(e){return[e,t.loadedPackages[e].map(function(t){return t.getPath()})]})},e.prototype.getPrimitiveClass=function(t){var e=this.getClass(t);return null==e&&(e=new r.PrimitiveClassData(t,this),this.addClass(t,e)),e},e.prototype._loadClass=function(t,e,n,a){var r=this;void 0===a&&(a=!0),c["default"](l.is_reference_type(e));var o,i=l.descriptor2typestr(e),u=this.classpath.length,p=[];t:for(var f=0;f void) => void","null"],vmindex:["number","-1"]},"Ljava/lang/Object;":{ref:["number","getRef()"],$monitor:["Monitor","null"]},"Ljava/net/PlainSocketImpl;":{$is_shutdown:["boolean","false"],$ws:["Interfaces.IWebsock","null"]},"Ljava/lang/Class;":{$cls:["ClassData","null"],signers:["JVMTypes.java_lang_Object[]","null"]},"Ljava/lang/ClassLoader;":{$loader:["ClassLoader","new CustomClassLoader(thread.getBsCl(), this);"]},"Ljava/lang/Thread;":{$thread:["JVMThread","thread ? new thread.constructor(thread.getJVM(), thread.getThreadPool(), this) : null"]}},T={"Ljava/lang/Object;":{getClass:["(): ClassData","function() { return this.constructor.cls }"],getMonitor:["(): Monitor","function() {\n if (this.$monitor === null) {\n this.$monitor = new Monitor();\n }\n return this.$monitor;\n}"]},"Ljava/lang/String;":{toString:["(): string","function() { return util.chars2jsStr(this['java/lang/String/value']); }"]},"Ljava/lang/Byte;":{unbox:["(): number","function() { return this['java/lang/Byte/value']; }"]},"Ljava/lang/Character;":{unbox:["(): number","function() { return this['java/lang/Character/value']; }"]},"Ljava/lang/Double;":{unbox:["(): number","function() { return this['java/lang/Double/value']; }"]},"Ljava/lang/Float;":{unbox:["(): number","function() { return this['java/lang/Float/value']; }"]},"Ljava/lang/Integer;":{unbox:["(): number","function() { return this['java/lang/Integer/value']; }"]},"Ljava/lang/Long;":{unbox:["(): Long","function() { return this['java/lang/Long/value']; }"]},"Ljava/lang/Short;":{unbox:["(): number","function() { return this['java/lang/Short/value']; }"]},"Ljava/lang/Boolean;":{unbox:["(): number","function() { return this['java/lang/Boolean/value']; }"]},"Ljava/lang/Void;":{unbox:["(): number",'function() { throw new Error("Cannot unbox a Void type."); }']},"Ljava/lang/invoke/MethodType;":{toString:["(): string",'function() { return "(" + this[\'java/lang/invoke/MethodType/ptypes\'].array.map(function (type) { return type.$cls.getInternalName(); }).join("") + ")" + this[\'java/lang/invoke/MethodType/rtype\'].$cls.getInternalName(); }']}},N={"Ljava/lang/Byte;":{box:["(val: number): java_lang_Byte","function(val) { var rv = new this(null); rv['java/lang/Byte/value'] = val; return rv; }"]},"Ljava/lang/Character;":{box:["(val: number): java_lang_Character","function(val) { var rv = new this(null); rv['java/lang/Character/value'] = val; return rv; }"]},"Ljava/lang/Double;":{box:["(val: number): java_lang_Double","function(val) { var rv = new this(null); rv['java/lang/Double/value'] = val; return rv; }"]},"Ljava/lang/Float;":{box:["(val: number): java_lang_Float","function(val) { var rv = new this(null); rv['java/lang/Float/value'] = val; return rv; }"]},"Ljava/lang/Integer;":{box:["(val: number): java_lang_Integer","function(val) { var rv = new this(null); rv['java/lang/Integer/value'] = val; return rv; }"]},"Ljava/lang/Long;":{box:["(val: Long): java_lang_Long","function(val) { var rv = new this(null); rv['java/lang/Long/value'] = val; return rv; }"]},"Ljava/lang/Short;":{box:["(val: number): java_lang_Short","function(val) { var rv = new this(null); rv['java/lang/Short/value'] = val; return rv; }"]},"Ljava/lang/Boolean;":{box:["(val: number): java_lang_Boolean","function(val) { var rv = new this(null); rv['java/lang/Boolean/value'] = val; return rv; }"]},"Ljava/lang/Void;":{box:["(): java_lang_Void","function() { return new this(null); }"]}},C=function(){function t(t){this.accessFlags=null,this.state=g.ClassState.LOADED,this.jco=null,this.superClass=null,this.loader=t}return t.prototype.getExternalName=function(){return i.ext_classname(this.className)},t.prototype.getInternalName=function(){return this.className},t.prototype.getPackageName=function(){var t,e=this.getExternalName();for(t=e.length-1;t>=0&&"."!==e[t];t--);return t>=0?e.slice(0,t):""},t.prototype.getLoader=function(){return this.loader},t.prototype.getSuperClass=function(){return this.superClass},t.prototype.getInterfaces=function(){return[]},t.prototype.getInjectedFields=function(){var t={};if(void 0!==L[this.getInternalName()]){var e=L[this.getInternalName()];Object.keys(e).forEach(function(n){t[n]=e[n][0]})}return t},t.prototype.getInjectedMethods=function(){var t={},e=this.getInternalName();if("["===e[0]&&(e="["),void 0!==T[e]){var n=T[e];Object.keys(n).forEach(function(e){t[e]=n[e][0]})}return t},t.prototype.getInjectedStaticMethods=function(){var t={},e=this.getInternalName();if("["===e[0]&&(e="["),void 0!==N[e]){var n=N[e];Object.keys(n).forEach(function(e){t[e]=n[e][0]})}return t},t.prototype.getClassObject=function(t){return null===this.jco&&(this.jco=new(t.getBsCl().getResolvedClass("Ljava/lang/Class;").getConstructor(t))(t),this.jco.$cls=this,this.jco["java/lang/Class/classLoader"]=this.getLoader().getLoaderObject()),this.jco},t.prototype.getProtectionDomain=function(){return null},t.prototype.getMethod=function(t){return null},t.prototype.getMethods=function(){return[]},t.prototype.getFields=function(){return[]},t.prototype.setState=function(t){this.state=t},t.prototype.getState=function(){if(this.state===g.ClassState.RESOLVED&&null===this.getMethod("()V")){var t=this.getSuperClass();null!==t&&t.getState()===g.ClassState.INITIALIZED&&(this.state=g.ClassState.INITIALIZED)}return this.state},t.prototype.isInitialized=function(t){return this.getState()===g.ClassState.INITIALIZED},t.prototype.isResolved=function(){return this.getState()!==g.ClassState.LOADED},t.prototype.isSubinterface=function(t){return!1},t.prototype.isSubclass=function(t){return this===t||null!==this.getSuperClass()&&this.getSuperClass().isSubclass(t)},t.prototype.resolve=function(t,e,n){throw void 0===n&&(n=!0),Error("Unimplemented.")},t.prototype.initialize=function(t,e,n){throw void 0===n&&(n=!0),Error("Unimplemented.")},t.prototype.outputInjectedMethods=function(t,e){var n=this.getInternalName();if("["===n[0]&&(n="["),void 0!==T[n]){var a=T[n];Object.keys(a).forEach(function(n){e.write(" "+t+".prototype."+n+" = "+a[n][1]+";\n")})}if(void 0!==N[n]){var r=N[n];Object.keys(r).forEach(function(n){e.write(" "+t+"."+n+" = "+r[n][1]+";\n")})}},t}();e.ClassData=C;var S=function(t){function e(e,n){t.call(this,n),this.className=e,this.accessFlags=new i.Flags(1041),this.setState(g.ClassState.INITIALIZED)}return o(e,t),e.prototype.isCastable=function(t){return this.className===t.getInternalName()},e.prototype.boxClassName=function(){return i.boxClassName(this.className)},e.prototype.createWrapperObject=function(t,e){var n=this.boxClassName(),a=t.getBsCl().getInitializedClass(t,n),r=a.getConstructor(t),o=new r(t);return"V"!==n&&(o[i.descriptor2typestr(n)+"/value"]=e,m["default"]("number"==typeof e||"boolean"==typeof e||"number"==typeof e.low_,"Invalid primitive value: "+e)),o},e.prototype.tryToResolve=function(){return!0},e.prototype.tryToInitialize=function(){return!0},e.prototype.resolve=function(t,e,n){var a=this;void 0===n&&(n=!0),setImmediate(function(){return e(a)})},e}(C);e.PrimitiveClassData=S;var b=function(t){function e(e,n){t.call(this,n),this._constructor=null,this.className="["+e,this.accessFlags=new i.Flags(1041),this.componentClassName=e}return o(e,t),e.prototype.methodLookup=function(t){return this.superClass.methodLookup(t)},e.prototype.fieldLookup=function(t){return this.superClass.fieldLookup(t)},e.prototype.resolve=function(t,e,n){var a=this;return void 0===n&&(n=!0),this.isResolved()?void setImmediate(function(){return e(a)}):void i.asyncForEach(["Ljava/lang/Object;",this.componentClassName],function(e,n){a.loader.resolveClass(t,e,function(t){null!==t?n():n("Failed.")})},function(t){t?e(null):(a.setResolved(a.loader.getResolvedClass("Ljava/lang/Object;"),a.loader.getResolvedClass(a.componentClassName)),e(a))})},e.prototype.getComponentClass=function(){return this.componentClass},e.prototype.setResolved=function(t,e){this.superClass=t,this.componentClass=e,this.setState(g.ClassState.INITIALIZED)},e.prototype.tryToResolve=function(){var t=this.loader,e=t.getResolvedClass("Ljava/lang/Object;"),n=t.getResolvedClass(this.componentClassName); return null!==e&&null!==n&&(this.setResolved(e,n),!0)},e.prototype.tryToInitialize=function(){return this.tryToResolve()},e.prototype.isCastable=function(t){if(!(t instanceof e)){if(t instanceof S)return!1;if(t.accessFlags.isInterface()){var n=t.getInternalName();return"Ljava/lang/Cloneable;"===n||"Ljava/io/Serializable;"===n}return"Ljava/lang/Object;"===t.getInternalName()}return this.getComponentClass().isCastable(t.getComponentClass())},e.prototype.initialize=function(t,e,n){void 0===n&&(n=!0),this.resolve(t,e,n)},e.prototype.getJSArrayConstructor=function(){if(!i.typedArraysSupported)return"Array";switch(this.componentClassName){case"B":return"Int8Array";case"C":return"Uint16Array";case"S":return"Int16Array";case"I":return"Int32Array";case"F":return"Float32Array";case"D":return"Float64Array";default:return"Array"}},e.prototype.getJSDefaultArrayElement=function(){switch(this.componentClassName[0]){case"[":return"new (cls.getComponentClass().getConstructor())(thread, otherLengths)";case"L":return"null";case"J":return"gLongZero";default:return"0"}},e.prototype._getSliceMethod=function(){var t=new I["default"],e=this.getJSArrayConstructor();if(t.write("function(start, end) {\n var newObj = new this.constructor(null, 0);\n"),"Array"===e)t.write(" newObj.array = this.array.slice(start, end);\n");else{var n;switch(e){case"Int8Array":n=1;break;case"Int16Array":case"Uint16Array":n=2;break;case"Int32Array":case"Float32Array":n=4;break;case"Float64Array":n=8;break;default:m["default"](!1,"Illegal array type returned??")}t.write(" if (end === undefined) end = this.array.length;\n "+(n>1?"start *= "+n+";\nend *= "+n+";":"")+"\n newObj.array = new "+e+"(this.array.buffer.slice(start, end));\n")}return t.write(" return newObj;\n }"),t.flush()},e.prototype._constructConstructor=function(t){m["default"](null===this._constructor,"Tried to construct constructor twice for "+this.getExternalName()+"!");var e=new I["default"],n=i.jvmName2JSName(this.getInternalName());e.write("extendClass("+n+", superCls.getConstructor(thread));\n function "+n+"(thread, lengths) {\n"),this.superClass.outputInjectedFields(e),"["!==this.componentClassName[0]?(e.write(" this.array = new "+this.getJSArrayConstructor()+"(lengths);\n"),"Array"===this.getJSArrayConstructor()&&e.write(" for (var i = 0; i < lengths; i++) {\n this.array[i] = "+this.getJSDefaultArrayElement()+";\n }\n")):e.write(" if (typeof lengths === 'number') {\n this.array = new "+this.getJSArrayConstructor()+"(lengths);\n for (var i = 0; i < length; i++) {\n this.array[i] = null;\n }\n } else {\n var length = lengths[0], otherLengths = lengths.length > 2 ? lengths.slice(1) : lengths[1];\n this.array = new "+this.getJSArrayConstructor()+"(length);\n for (var i = 0; i < length; i++) {\n this.array[i] = "+this.getJSDefaultArrayElement()+";\n }\n }\n"),e.write(" }\n\n "+n+".prototype.slice = "+this._getSliceMethod()+";\n "+n+".cls = cls;\n"),this.outputInjectedMethods(n,e),e.write("\n return "+n+";");var o=Function("extendClass","cls","superCls","gLongZero","thread","getRef","util",e.flush());return o(r,this,this.superClass,_["default"].ZERO,t,a,s)},e.prototype.getConstructor=function(t){return m["default"](this.isResolved(),"Tried to get constructor for class "+this.getInternalName()+" before it was resolved."),null===this._constructor&&(this._constructor=this._constructConstructor(t)),this._constructor},e}(C);e.ArrayClassData=b;var A=function(t){function e(e,n,a,r){t.call(this,a),this.interfaceClasses=null,this.superClassRef=null,this.initLock=new v["default"],this._constructor=null,this._fieldLookup={},this._objectFields=[],this._staticFields=[],this._methodLookup={},this._vmTable=[],this._uninheritedDefaultMethods=[],this._protectionDomain=n?n:null;var o=new l["default"](e),s=0;if(3405691582!==o.getUint32())throw Error("Magic number invalid");if(this.minorVersion=o.getUint16(),this.majorVersion=o.getUint16(),!(45<=this.majorVersion&&this.majorVersion<=52))throw Error("Major version invalid");this.constantPool=new u.ConstantPool,this.constantPool.parse(o,r),this.accessFlags=new i.Flags(o.getUint16()),this.className=this.constantPool.get(o.getUint16()).name;var p=o.getUint16();0!==p&&(this.superClassRef=this.constantPool.get(p));var f=o.getUint16();for(this.interfaceRefs=Array(f),s=0;s"===e.name||(void 0===n?t._vmTable.push(e):t._vmTable[t._vmTable.indexOf(n)]=e),t._methodLookup[e.signature]=e}),this.interfaceClasses.forEach(function(e){Object.keys(e._methodLookup).forEach(function(n){var a=e._methodLookup[n];void 0===t._methodLookup[n]?(a.accessFlags.isStatic()||t._vmTable.push(a),t._methodLookup[n]=a):a.isDefault()&&t._uninheritedDefaultMethods.push(a)})})},e.prototype._resolveFields=function(){var t=this;null!==this.superClass&&(this._objectFields=this._objectFields.concat(this.superClass._objectFields),Object.keys(this.superClass._fieldLookup).forEach(function(e){t._fieldLookup[e]=t.superClass._fieldLookup[e]})),this.interfaceClasses.forEach(function(e){Object.keys(e._fieldLookup).forEach(function(n){var a=e._fieldLookup[n];m["default"](a.accessFlags.isStatic(),"Interface fields must be static."),t._fieldLookup[n]=a})}),this.fields.forEach(function(e){t._fieldLookup[e.name]=e,e.accessFlags.isStatic()?t._staticFields.push(e):t._objectFields.push(e)})},e.prototype.methodLookup=function(t){var e=this._methodLookup[t];return void 0!==e?e:null},e.prototype.signaturePolymorphicAwareMethodLookup=function(t){var e;if(null!==(e=this.methodLookup(t)))return e;if("Ljava/lang/invoke/MethodHandle;"===this.className){var n=t.slice(0,t.indexOf("("))+"([Ljava/lang/Object;)Ljava/lang/Object;",e=this._methodLookup[n];if(void 0!==e&&e.accessFlags.isNative()&&e.accessFlags.isVarArgs()&&e.cls===this)return e}else if(null!==this.superClass)return this.superClass.signaturePolymorphicAwareMethodLookup(t);return null},e.prototype.fieldLookup=function(t){var e=this._fieldLookup[t];return void 0!==e?e:null},e.prototype.getAttribute=function(t){for(var e=this.attrs,n=0;n()V");return null===t&&(this.setState(g.ClassState.INITIALIZED),!0)}return!1},e.prototype.isCastable=function(t){return t instanceof e&&(this.accessFlags.isInterface()?t.accessFlags.isInterface()?this.isSubinterface(t):t.accessFlags.isInterface()?void 0:"Ljava/lang/Object;"===t.getInternalName():t.accessFlags.isInterface()?this.isSubinterface(t):this.isSubclass(t))},e.prototype.isSubinterface=function(t){if(this.className===t.getInternalName())return!0;for(var e=this.getInterfaces(),n=0;n()V"]?a["()V"](t,null,function(a){a?(n.setState(g.ClassState.RESOLVED),a.getClass().isCastable(t.getBsCl().getResolvedClass("Ljava/lang/Error;"))?(t.throwException(a),e(null)):t.getBsCl().initializeClass(t,"Ljava/lang/ExceptionInInitializerError;",function(n){if(null==n)e(null);else{var r=n.getConstructor(t),o=new r(t);o["(Ljava/lang/Throwable;)V"](t,[a],function(n){t.throwException(o),e(null)})}})):(n.setState(g.ClassState.INITIALIZED),e(n))}):(this.setState(g.ClassState.INITIALIZED),e(this))},e.prototype.isInitialized=function(t){return this.getState()===g.ClassState.INITIALIZED||this.initLock.getOwner()===t},e.prototype.resolve=function(t,e,n){var a=this;void 0===n&&(n=!0);var r=this.interfaceRefs.slice(0);null!==this.superClassRef&&r.push(this.superClassRef),r=r.filter(function(t){return!t.isResolved()}),i.asyncForEach(r,function(e,r){e.resolve(t,a.loader,a,function(t){t?r():r("Failed.")},n)},function(t){t?e(null):(a.setResolved(null!==a.superClassRef?a.superClassRef.cls:null,a.interfaceRefs.map(function(t){return t.cls})),e(a))})},e.prototype.getMirandaAndDefaultMethods=function(){var t=this,e=null!==this.superClass?this.superClass.getVMTable():[];return this.getVMTable().slice(e.length).filter(function(e){return e.cls!==t})},e.prototype.outputInjectedFields=function(t){null!==this.superClass&&this.superClass.outputInjectedFields(t);var e=L[this.getInternalName()];void 0!==e&&Object.keys(e).forEach(function(n){t.write("this."+n+" = "+e[n][1]+";\n")})},e.prototype._constructConstructor=function(t){m["default"](null===this._constructor,"Attempted to construct constructor twice for class "+this.getExternalName()+"!");var e=i.jvmName2JSName(this.getInternalName()),n=new I["default"];n.write("if (cls.superClass !== null) {\n extendClass("+e+", cls.superClass.getConstructor(thread));\n }\n function "+e+"(thread) {\n"),this.outputInjectedFields(n),this._objectFields.forEach(function(t){return t.outputJavaScriptField(e,n)}),n.write(" }\n "+e+".cls = cls;\n"),this.outputInjectedMethods(e,n),this._staticFields.forEach(function(t){return t.outputJavaScriptField(e,n)}),this.getMethods().forEach(function(t){return t.outputJavaScriptFunction(e,n)}),this.getMirandaAndDefaultMethods().forEach(function(t){return t.outputJavaScriptFunction(e,n)}),this.getUninheritedDefaultMethods().forEach(function(t){return t.outputJavaScriptFunction(e,n,!0)}),n.write(" return "+e+";");var o=n.flush(),l=Function("extendClass","cls","InternalStackFrame","NativeStackFrame","BytecodeStackFrame","gLongZero","CustomClassLoader","Monitor","thread","getRef","util",o);return l(r,this,p.InternalStackFrame,p.NativeStackFrame,p.BytecodeStackFrame,_["default"].ZERO,d.CustomClassLoader,y["default"],t,a,s)},e.prototype.getConstructor=function(t){return null==this._constructor&&(m["default"](this.isResolved(),"Cannot construct "+this.getInternalName()+"'s constructor until it is resolved."),this._constructor=this._constructConstructor(t)),this._constructor},e}(C);e.ReferenceClassData=A},function(t,e,n){"use strict";var a=n(7),r=n(13),o=function(){function t(t){this.buffer=t,this._index=0}return t.prototype.incIndex=function(t){var e=this._index;return this._index+=t,e},t.prototype.rewind=function(){this._index=0},t.prototype.seek=function(t){r["default"](t>=0&&t0)return a.asyncForEach(f,function(a,r){a.resolve(t,e,n,function(t){t?r():r("Failed.")},l)},function(a){a?s(!1):c.constructCallSiteObject(t,e,n,i,s,l)});var h=t.getJVM().internString(this.nameAndTypeInfo.name),d=new(e.getInitializedClass(t,"[Ljava/lang/Object;").getConstructor(t))(t,1),g=u(),v=e.getInitializedClass(t,"Ljava/lang/invoke/MethodHandleNatives;").getConstructor(t);v["java/lang/invoke/MethodHandleNatives/linkCallSite(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;"](t,[n.getClassObject(t),p[0].methodHandle,h,this.methodType,g,d],function(e,n){e?(t.throwException(e),s(!1)):(c.setResolved(i,[n,d.array[0]]),s(!0))})},t.prototype.setResolved=function(t,e){void 0===this.callSiteObjects[t]&&(this.callSiteObjects[t]=e)},t.fromBytes=function(t,e){var n=t.getUint16(),a=t.getUint16(),i=e.get(a);return o["default"](i.getType()===r.ConstantPoolItemType.NAME_AND_TYPE,"ConstantPool InvokeDynamic types mismatch"),new this(n,i)},t.size=1,t.infoByteSize=4,t}();e.InvokeDynamic=I,i[r.ConstantPoolItemType.INVOKE_DYNAMIC]=I;var y=function(){function t(t,e){ -this.methodHandle=null,this.reference=t,this.referenceType=e}return t.prototype.getType=function(){return r.ConstantPoolItemType.METHOD_HANDLE},t.prototype.isResolved=function(){return null!==this.methodHandle},t.prototype.getConstant=function(t){return this.methodHandle},t.prototype.resolve=function(t,e,n,a,r){var o=this;return this.reference.isResolved()?void this.constructMethodHandleType(t,e,function(r){if(null===r)a(!1);else{var i=e.getInitializedClass(t,"Ljava/lang/invoke/MethodHandleNatives;").getConstructor(t);i["linkMethodHandleConstant(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/invoke/MethodHandle;"](t,[n.getClassObject(t),o.referenceType,o.getDefiningClassObj(t),t.getJVM().internString(o.reference.nameAndTypeInfo.name),r],function(e,n){e?(t.throwException(e),a(!1)):(o.methodHandle=n,a(!0))})}}):this.reference.resolve(t,e,n,function(i){i?o.resolve(t,e,n,a,r):a(!1)},r)},t.prototype.getDefiningClassObj=function(t){return this.reference.getType()===r.ConstantPoolItemType.FIELDREF?this.reference.field.cls.getClassObject(t):this.reference.method.cls.getClassObject(t)},t.prototype.constructMethodHandleType=function(t,e,n){if(this.reference.getType()===r.ConstantPoolItemType.FIELDREF){var o=this.reference.nameAndTypeInfo.descriptor;e.resolveClass(t,o,function(e){n(null!==e?e.getClassObject(t):null)})}else a.createMethodType(t,e,this.reference.nameAndTypeInfo.descriptor,function(e,a){e?(t.throwException(e),n(null)):n(a)})},t.fromBytes=function(t,e){var n=t.getUint8(),a=t.getUint16(),i=e.get(a);return o["default"](0"===i.nameAndTypeInfo.name}return!0}(),"Invalid constant pool reference for method handle reference type: "+r.MethodHandleReferenceKind[n]),new this(i,n)},t.size=1,t.infoByteSize=3,t}();e.MethodHandle=y,i[r.ConstantPoolItemType.METHOD_HANDLE]=y;var E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];!function(t){t.forEach(function(t,e){t.forEach(function(t){E[t]=e})})}([[r.ConstantPoolItemType.UTF8,r.ConstantPoolItemType.INTEGER,r.ConstantPoolItemType.FLOAT,r.ConstantPoolItemType.LONG,r.ConstantPoolItemType.DOUBLE],[r.ConstantPoolItemType.CLASS,r.ConstantPoolItemType.STRING,r.ConstantPoolItemType.NAME_AND_TYPE,r.ConstantPoolItemType.METHOD_TYPE],[r.ConstantPoolItemType.FIELDREF,r.ConstantPoolItemType.METHODREF,r.ConstantPoolItemType.INTERFACE_METHODREF,r.ConstantPoolItemType.INVOKE_DYNAMIC],[r.ConstantPoolItemType.METHOD_HANDLE]]);var L=function(){function t(){}return t.prototype.parse=function(t,e){var n=this;void 0===e&&(e=null);var a=t.getUint16(),s=[[],[],[]],l=0,u=1,c=0,p=0,f=0;for(this.constantPool=Array(a);u0?(s[f-1].push({offset:p,index:u}),t.skip(i[c].infoByteSize)):this.constantPool[u]=i[c].fromBytes(t,this),u+=i[c].size;return l=t.pos(),s.forEach(function(a){a.forEach(function(a){if(t.seek(a.offset),c=t.getUint8(),n.constantPool[a.index]=i[c].fromBytes(t,n),null!==e&&null!==e.array[a.index]&&void 0!==e.array[a.index]){var s=e.array[a.index];switch(s.getClass().getInternalName()){case"Ljava/lang/Integer;":o["default"](c===r.ConstantPoolItemType.INTEGER),n.constantPool[a.index].value=s["java/lang/Integer/value"];break;case"Ljava/lang/Long;":o["default"](c===r.ConstantPoolItemType.LONG),n.constantPool[a.index].value=s["java/lang/Long/value"];break;case"Ljava/lang/Float;":o["default"](c===r.ConstantPoolItemType.FLOAT),n.constantPool[a.index].value=s["java/lang/Float/value"];break;case"Ljava/lang/Double;":o["default"](c===r.ConstantPoolItemType.DOUBLE),n.constantPool[a.index].value=s["java/lang/Double/value"];break;case"Ljava/lang/String;":o["default"](c===r.ConstantPoolItemType.UTF8),n.constantPool[a.index].value=""+s;break;case"Ljava/lang/Class;":o["default"](c===r.ConstantPoolItemType.CLASS),n.constantPool[a.index].name=s.$cls.getInternalName(),n.constantPool[a.index].cls=s.$cls;break;default:o["default"](c===r.ConstantPoolItemType.STRING),n.constantPool[a.index].stringValue="",n.constantPool[a.index].value=s}}})}),t.seek(l),t},t.prototype.get=function(t){return o["default"](void 0!==this.constantPool[t],"Invalid ConstantPool reference."),this.constantPool[t]},t.prototype.each=function(t){this.constantPool.forEach(function(e,n){void 0!==e&&t(n,e)})},t}();e.ConstantPool=L},function(t,e){"use strict";var n=function(){function t(){this.queue=[]}return t.prototype.tryLock=function(t,e){return 1===this.queue.push({thread:t,cb:e})},t.prototype.unlock=function(t){var e,n=this.queue.length;for(e=0;e0?this.queue[0].thread:null},t}();e.__esModule=!0,e["default"]=n},function(t,e,n){"use strict";var a=n(8),r=n(13),o=function(){function t(){this.owner=null,this.count=0,this.blocked={},this.waiting={}}return t.prototype.enter=function(t,e){return this.owner===t?(this.count++,!0):this.contendForLock(t,1,a.ThreadStatus.BLOCKED,e)},t.prototype.contendForLock=function(t,e,n,a){var o=this.owner;return r["default"](o!=t,"Thread attempting to contend for lock it already owns!"),null===o?(r["default"](0===this.count),this.owner=t,this.count=e,!0):(this.blocked[t.getRef()]={thread:t,cb:a,count:e},t.setStatus(n,this),!1)},t.prototype.exit=function(t){var e=this.owner;return e===t?0===--this.count&&(this.owner=null,this.appointNewOwner()):t.throwNewException("Ljava/lang/IllegalMonitorStateException;","Cannot exit a monitor that you do not own."),e===t},t.prototype.appointNewOwner=function(){var t=Object.keys(this.blocked);if(t.length>0){var e=t[Math.floor(Math.random()*t.length)],n=this.blocked[e];this.unblock(n.thread,!1)}},t.prototype.wait=function(t,e,n,o){var i=this;return this.getOwner()===t?(r["default"](t.getStatus()!==a.ThreadStatus.BLOCKED),this.waiting[t.getRef()]={thread:t,cb:e,count:this.count,isTimed:null!=n&&0!==n},this.owner=null,this.count=0,null!=n&&0!==n?(this.waiting[t.getRef()].timer=setTimeout(function(){i.unwait(t,!0)},n),t.setStatus(a.ThreadStatus.TIMED_WAITING,this)):t.setStatus(a.ThreadStatus.WAITING,this),this.appointNewOwner(),!0):(t.throwNewException("Ljava/lang/IllegalMonitorStateException;","Cannot wait on an object that you do not own."),!1)},t.prototype.unwait=function(t,e,n,o){void 0===n&&(n=!1),void 0===o&&(o=null);var i=this.waiting[t.getRef()],s=a.ThreadStatus.UNINTERRUPTABLY_BLOCKED,l=function(){t.setStatus(a.ThreadStatus.RUNNABLE),n?o():i.cb(e)};if(r["default"](null!=i),delete this.waiting[t.getRef()],t.getStatus()===a.ThreadStatus.TIMED_WAITING&&!e){var u=i.timer;r["default"](null!=u),clearTimeout(u)}this.contendForLock(t,i.count,s,l)&&l()},t.prototype.unblock=function(t,e){void 0===e&&(e=!1);var n=this.blocked[t.getRef()];r["default"](!e||t.getStatus()===a.ThreadStatus.BLOCKED),null!=n&&(delete this.blocked[t.getRef()],t.setStatus(a.ThreadStatus.RUNNABLE),e||(r["default"](null==this.owner&&0===this.count,"T"+t.getRef()+": We're not interrupting a block, but someone else owns the monitor?! Owned by "+(null==this.owner?"[no one]":""+this.owner.getRef())+" Count: "+this.count),this.owner=t,this.count=n.count,n.cb()))},t.prototype.notify=function(t){if(this.owner===t){var e=Object.keys(this.waiting);e.length>0&&this.unwait(this.waiting[e[Math.floor(Math.random()*e.length)]].thread,!1)}else t.throwNewException("Ljava/lang/IllegalMonitorStateException;","Cannot notify on a monitor that you do not own.")},t.prototype.notifyAll=function(t){if(this.owner===t){var e,n=Object.keys(this.waiting);for(e=0;e0)switch(o[0]){case"%":case"@":continue;case"!":case"#":var i=o.slice(2);n[i]=a={};break;default:"/"===o[o.length-1]&&(o=o.slice(0,o.length-1));var s=o.split("/"),l=a,u=void 0;for(u=0;u0;){var i=a.pop();try{var s=o.statSync(i);if(s.isDirectory())for(var l=o.readdirSync(i),u=0;u0){var n=t._queue[0];o["default"](n.getStatus()===r.ThreadStatus.RUNNABLE,"Attempted to run non-runnable thread."),n.run()}}))},t.prototype.unscheduleThread=function(t){var e=this._queue,n=e[0]===t;o["default"](e.indexOf(t)>-1,"Tried to unschedule thread that was not scheduled."),n?(e.shift(),this._count=0,this.runThread()):e.splice(e.indexOf(t),1)},t.prototype.getRunningThread=function(){var t=this._queue;return t.length>0?t[0]:null},t.prototype.priorityChange=function(t){},t.prototype.quantumOver=function(t){o["default"](this._queue[0]===t,"A non-running thread has an expired quantum?"),this._count++,(this._count>=t.getPriority()||t.getStatus()!==r.ThreadStatus.RUNNABLE)&&(this._count=0,this._queue.push(this._queue.shift())),this.runThread()},t}(),s=function(){function t(t){this.threads=[],this.scheduler=new i,this.emptyCallback=t}return t.prototype.getThreads=function(){return this.threads.slice(0)},t.prototype.anyNonDaemonicThreads=function(){for(var t=0;t=0),this.threads.splice(e,1),!this.anyNonDaemonicThreads()){var n=this.emptyCallback();n&&(this.emptyCallback=null)}},t.prototype.statusChange=function(t,e,n){var o=a(e),i=a(n);e!==r.ThreadStatus.NEW&&e!==r.ThreadStatus.TERMINATED||this.threads.indexOf(t)===-1&&this.threads.push(t),o!==i&&(o?this.scheduler.unscheduleThread(t):this.scheduler.scheduleThread(t)),n===r.ThreadStatus.TERMINATED&&this.threadTerminated(t)},t.prototype.priorityChange=function(t){this.scheduler.priorityChange(t)},t.prototype.quantumOver=function(t){this.scheduler.quantumOver(t)},t}();e.__esModule=!0,e["default"]=s},function(t,e){t.exports={url:"https://github.com/plasma-umass/doppio_jcl/releases/download/v3.2/java_home.tar.gz",classpath:["lib/rt.jar","lib/charsets.jar","lib/doppio.jar","lib/dt.jar","lib/jce.jar","lib/jconsole.jar","lib/jsse.jar","lib/management-agent.jar","lib/resources.jar","lib/sa-jdi.jar","lib/tools.jar"]}},function(module,exports){"use strict";function getGlobalRequire(){var reqVar=eval('typeof(require)!=="undefined"?require:null');return reqVar?reqVar:function(t){throw Error("Cannot find module "+t)}}exports.__esModule=!0,exports["default"]=getGlobalRequire},function(t,e){t.exports={name:"doppiojvm",version:"0.5.0",engine:"node >= 6.0.0",license:"MIT",main:"dist/release/doppio.js",typings:"dist/typings/src/doppiojvm",dependencies:{async:"^2.0.0",browserfs:"^1.0.0",glob:"^7.1.1","gunzip-maybe":"^1.3.1",optimist:"~0.6",pako:"^1.0.3",rimraf:"^2.5.4","source-map-support":"^0.4.3","tar-fs":"^1.13.2"},devDependencies:{"@types/async":"^2.0.32","@types/body-parser":"0.0.33","@types/dropboxjs":"0.0.29","@types/esprima":"^2.1.33","@types/express":"^4.0.33","@types/express-serve-static-core":"^4.0.37","@types/filesystem":"0.0.28","@types/glob":"^5.0.30","@types/grunt":"^0.4.20","@types/jasmine":"^2.5.35","@types/karma":"^0.13.33","@types/node":"6.0.33","@types/rimraf":"0.0.28","@types/semver":"^5.3.30","@types/serve-static":"^1.7.31","@types/source-map":"^0.1.28","@types/uglify-js":"^2.6.28","@types/underscore":"^1.7.33","@types/webpack":"^1.12.35","body-parser":"^1.15.2",cpr:"^2.0.0","detect-browser":"^1.3.1",escodegen:"^1.8.1",esprima:"^3.1.0",estraverse:"^4.2.0",express:"^4.13.4",grunt:"^1.0","grunt-cli":"^1.2","grunt-contrib-compress":"^1.2.0","grunt-contrib-connect":"^1.0","grunt-contrib-copy":"^1.0","grunt-contrib-uglify":"^2.0","grunt-karma":"^2.0","grunt-lineending":"^1.0.0","grunt-merge-source-maps":"^0.1.0","grunt-newer":"^1.2.0","grunt-ts":"6.0.0-beta.3","grunt-webpack":"^1.0.17","imports-loader":"^0.6.5","jasmine-core":"^2.5.2","json-loader":"^0.5.4",karma:"^1.3.0","karma-chrome-launcher":"^2.0","karma-firefox-launcher":"^1.0","karma-ie-launcher":"^1.0","karma-jasmine":"^1.0","karma-opera-launcher":"^1.0","karma-safari-launcher":"^1.0","locate-java-home":"^0.1.6",semver:"^5.3.0","source-map-loader":"^0.1.5",typescript:"^2.0.3","uglify-js":"^2.7.3",underscore:"^1.8.3",webpack:"^1.13.1","webpack-dev-server":"^1.16.2"},scripts:{test:"grunt test",prepublish:"node ./prepublish.js",install:"node ./install.js","appveyor-test":"grunt --stack test-browser-appveyor"},repository:{type:"git",url:"http://github.com/plasma-umass/doppio.git"},bin:{doppio:"./bin/doppio",doppioh:"./bin/doppioh","doppio-dev":"./bin/doppio-dev","doppio-fast-dev":"./bin/doppio-fast-dev"}}},function(module,exports,__webpack_require__){"use strict";function default_1(){var doppio_Debug=function(){function t(){}return t["SetLogLevel(Ldoppio/Debug$LogLevel;)V"]=function(t,e){logging.setLogLevel(e["doppio/Debug$LogLevel/level"])},t["GetLogLevel()Ldoppio/Debug$LogLevel;"]=function(t){var e=t.getBsCl().getInitializedClass(t,"Ldoppio/Debug$LogLevel;").getConstructor(t);switch(logging.logLevel){case LogLevel.VTRACE:return e["doppio/Debug$LogLevel/VTRACE"];case LogLevel.TRACE:return e["doppio/Debug$LogLevel/TRACE"];case LogLevel.DEBUG:return e["doppio/Debug$LogLevel/DEBUG"];default:return e["doppio/Debug$LogLevel/ERROR"]}},t}(),doppio_JavaScript=function(){function doppio_JavaScript(){}return doppio_JavaScript["eval(Ljava/lang/String;)Ljava/lang/String;"]=function(thread,to_eval){try{var rv=eval(""+to_eval);return null!=rv?util.initString(thread.getBsCl(),""+rv):null}catch(e){thread.throwNewException("Ljava/lang/Exception;","Error evaluating string: "+e)}},doppio_JavaScript}(),doppio_security_BrowserPRNG=function(){function t(){}return t["isAvailable()Z"]=function(e){var n=t.crypto;return!(!n||!n.getRandomValues)},t["engineSetSeed([B)V"]=function(t,e,n){t.throwNewException("Ljava/security/ProviderException;","engineSetSeed() failed.")},t["engineNextBytes([B)V"]=function(e,n,a){var r=t.crypto;r.getRandomValues(a.array)},t["engineGenerateSeed(I)[B"]=function(e,n,a){var r=t.crypto,o=util.newArrayFromClass(e,e.getBsCl().getInitializedClass(e,"[B"),a);return r.getRandomValues(o.array),o},t.crypto="undefined"!=typeof crypto?crypto:"undefined"!=typeof msCrypto?msCrypto:null,t}(),doppio_security_NodePRNG=function(){function t(){}return t["isAvailable()Z"]=function(t){return!util.are_in_browser()},t["engineSetSeed([B)V"]=function(t,e,n){t.throwNewException("Ljava/security/ProviderException;","engineSetSeed() failed.")},t["engineNextBytes([B)V"]=function(t,e,n){for(var a=n.array,r=a.length,o=NodeCrypto.randomBytes(r),i=0;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(e,this._blockSize-4);var n=this._update(this._block)||this._hash();return t?n.toString(t):n},e.prototype._update=function(){throw Error("_update must be implemented by subclass")},e}},function(t,e,n){var a=n(44).inherits;t.exports=function(t,e){function n(){return d.length?d.pop().init():this instanceof n?(this._w=h,e.call(this,64,56),this._h=null,void this.init()):new n}function r(t,e,n,a){return t<20?e&n|~e&a:t<40?e^n^a:t<60?e&n|e&a|n&a:e^n^a}function o(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}function i(t,e){return t+e|0}function s(t,e){return t<>>32-e}var l=0,u=4,c=8,p=12,f=16,h=new("undefined"==typeof Int32Array?Array:Int32Array)(80),d=[];return a(n,e),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,e.prototype.init.call(this),this},n.prototype._POOL=d,n.prototype._update=function(t){var e,n,a,l,u,c,p,f,h,d;e=c=this._a,n=p=this._b,a=f=this._c,l=h=this._d,u=d=this._e;for(var g=this._w,v=0;v<80;v++){var m=g[v]=v<16?t.readInt32BE(4*v):s(g[v-3]^g[v-8]^g[v-14]^g[v-16],1),_=i(i(s(e,5),r(v,n,a,l)),i(i(u,m),o(v)));u=l,l=a,a=s(n,30),n=e,e=_}this._a=i(e,c),this._b=i(n,p),this._c=i(a,f),this._d=i(l,h),this._e=i(u,d)},n.prototype._hash=function(){d.length<100&&d.push(this);var e=new t(20);return e.writeInt32BE(0|this._a,l),e.writeInt32BE(0|this._b,u),e.writeInt32BE(0|this._c,c),e.writeInt32BE(0|this._d,p),e.writeInt32BE(0|this._e,f),e},n}},function(t,e,n){(function(t,a){function r(t,n){var a={seen:[],stylize:i};return arguments.length>=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),g(n)?a.showHidden=n:n&&e._extend(a,n),E(a.showHidden)&&(a.showHidden=!1),E(a.depth)&&(a.depth=2),E(a.colors)&&(a.colors=!1),E(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=o),l(a,t,a.depth)}function o(t,e){var n=r.styles[e];return n?"["+r.colors[n][0]+"m"+t+"["+r.colors[n][1]+"m":t}function i(t,e){return t}function s(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function l(t,n,a){if(t.customInspect&&n&&S(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var r=n.inspect(a,t);return I(r)||(r=l(t,r,a)),r}var o=u(t,n);if(o)return o;var i=Object.keys(n),g=s(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(n)),C(n)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return c(n);if(0===i.length){if(S(n)){var v=n.name?": "+n.name:"";return t.stylize("[Function"+v+"]","special")}if(L(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(N(n))return t.stylize(Date.prototype.toString.call(n),"date");if(C(n))return c(n)}var m="",_=!1,y=["{","}"];if(d(n)&&(_=!0,y=["[","]"]),S(n)){var E=n.name?": "+n.name:"";m=" [Function"+E+"]"}if(L(n)&&(m=" "+RegExp.prototype.toString.call(n)),N(n)&&(m=" "+Date.prototype.toUTCString.call(n)),C(n)&&(m=" "+c(n)),0===i.length&&(!_||0==n.length))return y[0]+m+y[1];if(a<0)return L(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var T;return T=_?p(t,n,a,g,i):i.map(function(e){return f(t,n,a,g,e,_)}),t.seen.pop(),h(T,m,y)}function u(t,e){if(E(e))return t.stylize("undefined","undefined");if(I(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return _(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,a,r){for(var o=[],i=0,s=e.length;i-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),E(i)){if(o&&r.match(/^\d+$/))return s;i=JSON.stringify(""+r),i.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2), -+this.methodHandle=null,this.reference=t,this.referenceType=e}return t.prototype.getType=function(){return r.ConstantPoolItemType.METHOD_HANDLE},t.prototype.isResolved=function(){return null!==this.methodHandle},t.prototype.getConstant=function(t){return this.methodHandle},t.prototype.resolve=function(t,e,n,a,r){var o=this;return this.reference.isResolved()?void this.constructMethodHandleType(t,e,function(r){if(null===r)a(!1);else{var i=e.getInitializedClass(t,"Ljava/lang/invoke/MethodHandleNatives;").getConstructor(t);i["linkMethodHandleConstant(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/invoke/MethodHandle;"](t,[n.getClassObject(t),o.referenceType,o.getDefiningClassObj(t),t.getJVM().internString(o.reference.nameAndTypeInfo.name),r],function(e,n){e?(t.throwException(e),a(!1)):(o.methodHandle=n,a(!0))})}}):this.reference.resolve(t,e,n,function(i){i?o.resolve(t,e,n,a,r):a(!1)},r)},t.prototype.getDefiningClassObj=function(t){return this.reference.getType()===r.ConstantPoolItemType.FIELDREF?this.reference.field.cls.getClassObject(t):this.reference.method.cls.getClassObject(t)},t.prototype.constructMethodHandleType=function(t,e,n){if(this.reference.getType()===r.ConstantPoolItemType.FIELDREF){var o=this.reference.nameAndTypeInfo.descriptor;e.resolveClass(t,o,function(e){n(null!==e?e.getClassObject(t):null)})}else a.createMethodType(t,e,this.reference.nameAndTypeInfo.descriptor,function(e,a){e?(t.throwException(e),n(null)):n(a)})},t.fromBytes=function(t,e){var n=t.getUint8(),a=t.getUint16(),i=e.get(a);return o["default"](0"===i.nameAndTypeInfo.name}return!0}(),"Invalid constant pool reference for method handle reference type: "+r.MethodHandleReferenceKind[n]),new this(i,n)},t.size=1,t.infoByteSize=3,t}();e.MethodHandle=y,i[r.ConstantPoolItemType.METHOD_HANDLE]=y;var E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];!function(t){t.forEach(function(t,e){t.forEach(function(t){E[t]=e})})}([[r.ConstantPoolItemType.UTF8,r.ConstantPoolItemType.INTEGER,r.ConstantPoolItemType.FLOAT,r.ConstantPoolItemType.LONG,r.ConstantPoolItemType.DOUBLE],[r.ConstantPoolItemType.CLASS,r.ConstantPoolItemType.STRING,r.ConstantPoolItemType.NAME_AND_TYPE,r.ConstantPoolItemType.METHOD_TYPE],[r.ConstantPoolItemType.FIELDREF,r.ConstantPoolItemType.METHODREF,r.ConstantPoolItemType.INTERFACE_METHODREF,r.ConstantPoolItemType.INVOKE_DYNAMIC],[r.ConstantPoolItemType.METHOD_HANDLE]]);var L=function(){function t(){}return t.prototype.parse=function(t,e){var n=this;void 0===e&&(e=null);var a=t.getUint16(),s=[[],[],[]],l=0,u=1,c=0,p=0,f=0;for(this.constantPool=Array(a);u0?(s[f-1].push({offset:p,index:u}),t.skip(i[c].infoByteSize)):this.constantPool[u]=i[c].fromBytes(t,this),u+=i[c].size;return l=t.pos(),s.forEach(function(a){a.forEach(function(a){if(t.seek(a.offset),c=t.getUint8(),n.constantPool[a.index]=i[c].fromBytes(t,n),null!==e&&null!==e.array[a.index]&&void 0!==e.array[a.index]){var s=e.array[a.index];switch(s.getClass().getInternalName()){case"Ljava/lang/Integer;":o["default"](c===r.ConstantPoolItemType.INTEGER),n.constantPool[a.index].value=s["java/lang/Integer/value"];break;case"Ljava/lang/Long;":o["default"](c===r.ConstantPoolItemType.LONG),n.constantPool[a.index].value=s["java/lang/Long/value"];break;case"Ljava/lang/Float;":o["default"](c===r.ConstantPoolItemType.FLOAT),n.constantPool[a.index].value=s["java/lang/Float/value"];break;case"Ljava/lang/Double;":o["default"](c===r.ConstantPoolItemType.DOUBLE),n.constantPool[a.index].value=s["java/lang/Double/value"];break;case"Ljava/lang/String;":o["default"](c===r.ConstantPoolItemType.UTF8),n.constantPool[a.index].value=""+s;break;case"Ljava/lang/Class;":o["default"](c===r.ConstantPoolItemType.CLASS),n.constantPool[a.index].name=s.$cls.getInternalName(),n.constantPool[a.index].cls=s.$cls;break;default:o["default"](c===r.ConstantPoolItemType.STRING),n.constantPool[a.index].stringValue="",n.constantPool[a.index].value=s}}})}),t.seek(l),t},t.prototype.get=function(t){return o["default"](void 0!==this.constantPool[t],"Invalid ConstantPool reference."),this.constantPool[t]},t.prototype.each=function(t){this.constantPool.forEach(function(e,n){void 0!==e&&t(n,e)})},t}();e.ConstantPool=L},function(t,e){"use strict";var n=function(){function t(){this.queue=[]}return t.prototype.tryLock=function(t,e){return 1===this.queue.push({thread:t,cb:e})},t.prototype.unlock=function(t){var e,n=this.queue.length;for(e=0;e0?this.queue[0].thread:null},t}();e.__esModule=!0,e["default"]=n},function(t,e,n){"use strict";var a=n(8),r=n(13),o=function(){function t(){this.owner=null,this.count=0,this.blocked={},this.waiting={}}return t.prototype.enter=function(t,e){return this.owner===t?(this.count++,!0):this.contendForLock(t,1,a.ThreadStatus.BLOCKED,e)},t.prototype.contendForLock=function(t,e,n,a){var o=this.owner;return r["default"](o!=t,"Thread attempting to contend for lock it already owns!"),null===o?(r["default"](0===this.count),this.owner=t,this.count=e,!0):(this.blocked[t.getRef()]={thread:t,cb:a,count:e},t.setStatus(n,this),!1)},t.prototype.exit=function(t){var e=this.owner;return e===t?0===--this.count&&(this.owner=null,this.appointNewOwner()):t.throwNewException("Ljava/lang/IllegalMonitorStateException;","Cannot exit a monitor that you do not own."),e===t},t.prototype.appointNewOwner=function(){var t=Object.keys(this.blocked);if(t.length>0){var e=t[Math.floor(Math.random()*t.length)],n=this.blocked[e];this.unblock(n.thread,!1)}},t.prototype.wait=function(t,e,n,o){var i=this;return this.getOwner()===t?(r["default"](t.getStatus()!==a.ThreadStatus.BLOCKED),this.waiting[t.getRef()]={thread:t,cb:e,count:this.count,isTimed:null!=n&&0!==n},this.owner=null,this.count=0,null!=n&&0!==n?(this.waiting[t.getRef()].timer=setTimeout(function(){i.unwait(t,!0)},n),t.setStatus(a.ThreadStatus.TIMED_WAITING,this)):t.setStatus(a.ThreadStatus.WAITING,this),this.appointNewOwner(),!0):(t.throwNewException("Ljava/lang/IllegalMonitorStateException;","Cannot wait on an object that you do not own."),!1)},t.prototype.unwait=function(t,e,n,o){void 0===n&&(n=!1),void 0===o&&(o=null);var i=this.waiting[t.getRef()],s=a.ThreadStatus.UNINTERRUPTABLY_BLOCKED,l=function(){t.setStatus(a.ThreadStatus.RUNNABLE),n?o():i.cb(e)};if(r["default"](null!=i),delete this.waiting[t.getRef()],t.getStatus()===a.ThreadStatus.TIMED_WAITING&&!e){var u=i.timer;r["default"](null!=u),clearTimeout(u)}this.contendForLock(t,i.count,s,l)&&l()},t.prototype.unblock=function(t,e){void 0===e&&(e=!1);var n=this.blocked[t.getRef()];r["default"](!e||t.getStatus()===a.ThreadStatus.BLOCKED),null!=n&&(delete this.blocked[t.getRef()],t.setStatus(a.ThreadStatus.RUNNABLE),e||(r["default"](null==this.owner&&0===this.count,"T"+t.getRef()+": We're not interrupting a block, but someone else owns the monitor?! Owned by "+(null==this.owner?"[no one]":""+this.owner.getRef())+" Count: "+this.count),this.owner=t,this.count=n.count,n.cb()))},t.prototype.notify=function(t){if(this.owner===t){var e=Object.keys(this.waiting);e.length>0&&this.unwait(this.waiting[e[Math.floor(Math.random()*e.length)]].thread,!1)}else t.throwNewException("Ljava/lang/IllegalMonitorStateException;","Cannot notify on a monitor that you do not own.")},t.prototype.notifyAll=function(t){if(this.owner===t){var e,n=Object.keys(this.waiting);for(e=0;e0)switch(o[0]){case"%":case"@":continue;case"!":case"#":var i=o.slice(2);n[i]=a={};break;default:"/"===o[o.length-1]&&(o=o.slice(0,o.length-1));var s=o.split("/"),l=a,u=void 0;for(u=0;u0;){var i=a.pop();try{var s=o.statSync(i);if(s.isDirectory())for(var l=o.readdirSync(i),u=0;u0){var n=t._queue[0];o["default"](n.getStatus()===r.ThreadStatus.RUNNABLE,"Attempted to run non-runnable thread."),n.run()}}))},t.prototype.unscheduleThread=function(t){var e=this._queue,n=e[0]===t;o["default"](e.indexOf(t)>-1,"Tried to unschedule thread that was not scheduled."),n?(e.shift(),this._count=0,this.runThread()):e.splice(e.indexOf(t),1)},t.prototype.getRunningThread=function(){var t=this._queue;return t.length>0?t[0]:null},t.prototype.priorityChange=function(t){},t.prototype.quantumOver=function(t){o["default"](this._queue[0]===t,"A non-running thread has an expired quantum?"),this._count++,(this._count>=t.getPriority()||t.getStatus()!==r.ThreadStatus.RUNNABLE)&&(this._count=0,this._queue.push(this._queue.shift())),this.runThread()},t}(),s=function(){function t(t){this.threads=[],this.scheduler=new i,this.emptyCallback=t}return t.prototype.getThreads=function(){return this.threads.slice(0)},t.prototype.anyNonDaemonicThreads=function(){for(var t=0;t=0),this.threads.splice(e,1),!this.anyNonDaemonicThreads()){var n=this.emptyCallback();n&&(this.emptyCallback=null)}},t.prototype.statusChange=function(t,e,n){var o=a(e),i=a(n);e!==r.ThreadStatus.NEW&&e!==r.ThreadStatus.TERMINATED||this.threads.indexOf(t)===-1&&this.threads.push(t),o!==i&&(o?this.scheduler.unscheduleThread(t):this.scheduler.scheduleThread(t)),n===r.ThreadStatus.TERMINATED&&this.threadTerminated(t)},t.prototype.priorityChange=function(t){this.scheduler.priorityChange(t)},t.prototype.quantumOver=function(t){this.scheduler.quantumOver(t)},t}();e.__esModule=!0,e["default"]=s},function(t,e){t.exports={url:"https://github.com/plasma-umass/doppio_jcl/releases/download/v3.2/java_home.tar.gz",classpath:["lib/rt.jar","lib/charsets.jar","lib/doppio.jar","lib/dt.jar","lib/jce.jar","lib/jconsole.jar","lib/jsse.jar","lib/management-agent.jar","lib/resources.jar","lib/sa-jdi.jar","lib/tools.jar"]}},function(module,exports){"use strict";function getGlobalRequire(){var reqVar=eval('typeof(require)!=="undefined"?require:null');return reqVar?reqVar:function(t){throw Error("Cannot find module "+t)}}exports.__esModule=!0,exports["default"]=getGlobalRequire},function(t,e){t.exports={name:"doppiojvm",version:"0.5.0",engine:"node >= 6.0.0",license:"MIT",main:"dist/release/doppio.js",typings:"dist/typings/src/doppiojvm",dependencies:{async:"^2.0.0",browserfs:"^1.0.0",glob:"^7.1.1","gunzip-maybe":"^1.3.1",optimist:"~0.6",pako:"^1.0.3",rimraf:"^2.5.4","source-map-support":"^0.4.3","tar-fs":"^1.13.2"},devDependencies:{"@types/async":"^2.0.32","@types/body-parser":"0.0.33","@types/dropboxjs":"0.0.29","@types/esprima":"^2.1.33","@types/express":"^4.0.33","@types/express-serve-static-core":"^4.0.37","@types/filesystem":"0.0.28","@types/glob":"^5.0.30","@types/grunt":"^0.4.20","@types/jasmine":"^2.5.35","@types/karma":"^0.13.33","@types/node":"6.0.33","@types/rimraf":"0.0.28","@types/semver":"^5.3.30","@types/serve-static":"^1.7.31","@types/source-map":"^0.1.28","@types/uglify-js":"^2.6.28","@types/underscore":"^1.7.33","@types/webpack":"^1.12.35","body-parser":"^1.15.2",cpr:"^2.0.0","detect-browser":"^1.3.1",escodegen:"^1.8.1",esprima:"^3.1.0",estraverse:"^4.2.0",express:"^4.13.4",grunt:"^1.0","grunt-cli":"^1.2","grunt-contrib-compress":"^1.2.0","grunt-contrib-connect":"^1.0","grunt-contrib-copy":"^1.0","grunt-contrib-uglify":"^2.0","grunt-karma":"^2.0","grunt-lineending":"^1.0.0","grunt-merge-source-maps":"^0.1.0","grunt-newer":"^1.2.0","grunt-ts":"6.0.0-beta.3","grunt-webpack":"^1.0.17","imports-loader":"^0.6.5","jasmine-core":"^2.5.2","json-loader":"^0.5.4",karma:"^1.3.0","karma-chrome-launcher":"^2.0","karma-firefox-launcher":"^1.0","karma-ie-launcher":"^1.0","karma-jasmine":"^1.0","karma-opera-launcher":"^1.0","karma-safari-launcher":"^1.0","locate-java-home":"^0.1.6",semver:"^5.3.0","source-map-loader":"^0.1.5",typescript:"^2.0.3","uglify-js":"^2.7.3",underscore:"^1.8.3",webpack:"^1.13.1","webpack-dev-server":"^1.16.2"},scripts:{test:"grunt test",prepublish:"node ./prepublish.js",install:"node ./install.js","appveyor-test":"grunt --stack test-browser-appveyor"},repository:{type:"git",url:"http://github.com/plasma-umass/doppio.git"},bin:{doppio:"./bin/doppio",doppioh:"./bin/doppioh","doppio-dev":"./bin/doppio-dev","doppio-fast-dev":"./bin/doppio-fast-dev"}}},function(module,exports,__webpack_require__){"use strict";function default_1(){var doppio_Debug=function(){function t(){}return t["SetLogLevel(Ldoppio/Debug$LogLevel;)V"]=function(t,e){logging.setLogLevel(e["doppio/Debug$LogLevel/level"])},t["GetLogLevel()Ldoppio/Debug$LogLevel;"]=function(t){var e=t.getBsCl().getInitializedClass(t,"Ldoppio/Debug$LogLevel;").getConstructor(t);switch(logging.logLevel){case LogLevel.VTRACE:return e["doppio/Debug$LogLevel/VTRACE"];case LogLevel.TRACE:return e["doppio/Debug$LogLevel/TRACE"];case LogLevel.DEBUG:return e["doppio/Debug$LogLevel/DEBUG"];default:return e["doppio/Debug$LogLevel/ERROR"]}},t}(),doppio_JavaScript=function(){function doppio_JavaScript(){}return doppio_JavaScript["eval(Ljava/lang/String;)Ljava/lang/String;"]=function(thread,to_eval){try{var rv=eval(""+to_eval);return null!=rv?util.initString(thread.getBsCl(),""+rv):null}catch(e){thread.throwNewException("Ljava/lang/Exception;","Error evaluating string: "+e)}},doppio_JavaScript}(),doppio_security_BrowserPRNG=function(){function t(){}return t["isAvailable()Z"]=function(e){var n=t.crypto;return!(!n||!n.getRandomValues)},t["engineSetSeed([B)V"]=function(t,e,n){t.throwNewException("Ljava/security/ProviderException;","engineSetSeed() failed.")},t["engineNextBytes([B)V"]=function(e,n,a){var r=t.crypto;r.getRandomValues(a.array)},t["engineGenerateSeed(I)[B"]=function(e,n,a){var r=t.crypto,o=util.newArrayFromClass(e,e.getBsCl().getInitializedClass(e,"[B"),a);return r.getRandomValues(o.array),o},t.crypto="undefined"!=typeof crypto?crypto:"undefined"!=typeof msCrypto?msCrypto:null,t}(),doppio_security_NodePRNG=function(){function t(){}return t["isAvailable()Z"]=function(t){return!util.are_in_browser()},t["engineSetSeed([B)V"]=function(t,e,n){t.throwNewException("Ljava/security/ProviderException;","engineSetSeed() failed.")},t["engineNextBytes([B)V"]=function(t,e,n){for(var a=n.array,r=a.length,o=NodeCrypto.randomBytes(r),i=0;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(e,this._blockSize-4);var n=this._update(this._block)||this._hash();return t?n.toString(t):n},e.prototype._update=function(){throw Error("_update must be implemented by subclass")},e}},function(t,e,n){var a=n(44).inherits;t.exports=function(t,e){function n(){return d.length?d.pop().init():this instanceof n?(this._w=h,e.call(this,64,56),this._h=null,void this.init()):new n}function r(t,e,n,a){return t<20?e&n|~e&a:t<40?e^n^a:t<60?e&n|e&a|n&a:e^n^a}function o(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}function i(t,e){return t+e|0}function s(t,e){return t<>>32-e}var l=0,u=4,c=8,p=12,f=16,h=new("undefined"==typeof Int32Array?Array:Int32Array)(80),d=[];return a(n,e),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,e.prototype.init.call(this),this},n.prototype._POOL=d,n.prototype._update=function(t){var e,n,a,l,u,c,p,f,h,d;e=c=this._a,n=p=this._b,a=f=this._c,l=h=this._d,u=d=this._e;for(var g=this._w,v=0;v<80;v++){var m=g[v]=v<16?t.readInt32BE(4*v):s(g[v-3]^g[v-8]^g[v-14]^g[v-16],1),_=i(i(s(e,5),r(v,n,a,l)),i(i(u,m),o(v)));u=l,l=a,a=s(n,30),n=e,e=_}this._a=i(e,c),this._b=i(n,p),this._c=i(a,f),this._d=i(l,h),this._e=i(u,d)},n.prototype._hash=function(){d.length<100&&d.push(this);var e=new t(20);return e.writeInt32BE(0|this._a,l),e.writeInt32BE(0|this._b,u),e.writeInt32BE(0|this._c,c),e.writeInt32BE(0|this._d,p),e.writeInt32BE(0|this._e,f),e},n}},function(t,e,n){(function(t,a){function r(t,n){var a={seen:[],stylize:i};return arguments.length>=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),g(n)?a.showHidden=n:n&&e._extend(a,n),E(a.showHidden)&&(a.showHidden=!1),E(a.depth)&&(a.depth=2),E(a.colors)&&(a.colors=!1),E(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=o),l(a,t,a.depth)}function o(t,e){var n=r.styles[e];return n?"["+r.colors[n][0]+"m"+t+"["+r.colors[n][1]+"m":t}function i(t,e){return t}function s(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function l(t,n,a){if(t.customInspect&&n&&S(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var r=n.inspect(a,t);return I(r)||(r=l(t,r,a)),r}var o=u(t,n);if(o)return o;var i=Object.keys(n),g=s(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(n)),C(n)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return c(n);if(0===i.length){if(S(n)){var v=n.name?": "+n.name:"";return t.stylize("[Function"+v+"]","special")}if(L(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(N(n))return t.stylize(Date.prototype.toString.call(n),"date");if(C(n))return c(n)}var m="",_=!1,y=["{","}"];if(d(n)&&(_=!0,y=["[","]"]),S(n)){var E=n.name?": "+n.name:"";m=" [Function"+E+"]"}if(L(n)&&(m=" "+RegExp.prototype.toString.call(n)),N(n)&&(m=" "+Date.prototype.toUTCString.call(n)),C(n)&&(m=" "+c(n)),0===i.length&&(!_||0==n.length))return y[0]+m+y[1];if(a<0)return L(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var T;return T=_?p(t,n,a,g,i):i.map(function(e){return f(t,n,a,g,e,_)}),t.seen.pop(),h(T,m,y)}function u(t,e){if(E(e))return t.stylize("undefined","undefined");if(I(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return _(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,a,r){for(var o=[],i=0,s=e.length;i-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),E(i)){if(o&&r.match(/^\d+$/))return s;i=JSON.stringify(""+r),i.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2), ++this.methodHandle=null,this.reference=t,this.referenceType=e}return t.prototype.getType=function(){return r.ConstantPoolItemType.METHOD_HANDLE},t.prototype.isResolved=function(){return null!==this.methodHandle},t.prototype.getConstant=function(t){return this.methodHandle},t.prototype.resolve=function(t,e,n,a,r){var o=this;return this.reference.isResolved()?void this.constructMethodHandleType(t,e,function(r){if(null===r)a(!1);else{var i=e.getInitializedClass(t,"Ljava/lang/invoke/MethodHandleNatives;").getConstructor(t);i["linkMethodHandleConstant(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/invoke/MethodHandle;"](t,[n.getClassObject(t),o.referenceType,o.getDefiningClassObj(t),t.getJVM().internString(o.reference.nameAndTypeInfo.name),r],function(e,n){e?(t.throwException(e),a(!1)):(o.methodHandle=n,a(!0))})}}):this.reference.resolve(t,e,n,function(i){i?o.resolve(t,e,n,a,r):a(!1)},r)},t.prototype.getDefiningClassObj=function(t){return this.reference.getType()===r.ConstantPoolItemType.FIELDREF?this.reference.field.cls.getClassObject(t):this.reference.method.cls.getClassObject(t)},t.prototype.constructMethodHandleType=function(t,e,n){if(this.reference.getType()===r.ConstantPoolItemType.FIELDREF){var o=this.reference.nameAndTypeInfo.descriptor;e.resolveClass(t,o,function(e){n(null!==e?e.getClassObject(t):null)})}else a.createMethodType(t,e,this.reference.nameAndTypeInfo.descriptor,function(e,a){e?(t.throwException(e),n(null)):n(a)})},t.fromBytes=function(t,e){var n=t.getUint8(),a=t.getUint16(),i=e.get(a);return o["default"](0"===i.nameAndTypeInfo.name}return!0}(),"Invalid constant pool reference for method handle reference type: "+r.MethodHandleReferenceKind[n]),new this(i,n)},t.size=1,t.infoByteSize=3,t}();e.MethodHandle=y,i[r.ConstantPoolItemType.METHOD_HANDLE]=y;var E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];!function(t){t.forEach(function(t,e){t.forEach(function(t){E[t]=e})})}([[r.ConstantPoolItemType.UTF8,r.ConstantPoolItemType.INTEGER,r.ConstantPoolItemType.FLOAT,r.ConstantPoolItemType.LONG,r.ConstantPoolItemType.DOUBLE],[r.ConstantPoolItemType.CLASS,r.ConstantPoolItemType.STRING,r.ConstantPoolItemType.NAME_AND_TYPE,r.ConstantPoolItemType.METHOD_TYPE],[r.ConstantPoolItemType.FIELDREF,r.ConstantPoolItemType.METHODREF,r.ConstantPoolItemType.INTERFACE_METHODREF,r.ConstantPoolItemType.INVOKE_DYNAMIC],[r.ConstantPoolItemType.METHOD_HANDLE]]);var L=function(){function t(){}return t.prototype.parse=function(t,e){var n=this;void 0===e&&(e=null);var a=t.getUint16(),s=[[],[],[]],l=0,u=1,c=0,p=0,f=0;for(this.constantPool=Array(a);u0?(s[f-1].push({offset:p,index:u}),t.skip(i[c].infoByteSize)):this.constantPool[u]=i[c].fromBytes(t,this),u+=i[c].size;return l=t.pos(),s.forEach(function(a){a.forEach(function(a){if(t.seek(a.offset),c=t.getUint8(),n.constantPool[a.index]=i[c].fromBytes(t,n),null!==e&&null!==e.array[a.index]&&void 0!==e.array[a.index]){var s=e.array[a.index];switch(s.getClass().getInternalName()){case"Ljava/lang/Integer;":o["default"](c===r.ConstantPoolItemType.INTEGER),n.constantPool[a.index].value=s["java/lang/Integer/value"];break;case"Ljava/lang/Long;":o["default"](c===r.ConstantPoolItemType.LONG),n.constantPool[a.index].value=s["java/lang/Long/value"];break;case"Ljava/lang/Float;":o["default"](c===r.ConstantPoolItemType.FLOAT),n.constantPool[a.index].value=s["java/lang/Float/value"];break;case"Ljava/lang/Double;":o["default"](c===r.ConstantPoolItemType.DOUBLE),n.constantPool[a.index].value=s["java/lang/Double/value"];break;case"Ljava/lang/String;":o["default"](c===r.ConstantPoolItemType.UTF8),n.constantPool[a.index].value=""+s;break;case"Ljava/lang/Class;":o["default"](c===r.ConstantPoolItemType.CLASS),n.constantPool[a.index].name=s.$cls.getInternalName(),n.constantPool[a.index].cls=s.$cls;break;default:o["default"](c===r.ConstantPoolItemType.STRING),n.constantPool[a.index].stringValue="",n.constantPool[a.index].value=s}}})}),t.seek(l),t},t.prototype.get=function(t){return o["default"](void 0!==this.constantPool[t],"Invalid ConstantPool reference."),this.constantPool[t]},t.prototype.each=function(t){this.constantPool.forEach(function(e,n){void 0!==e&&t(n,e)})},t}();e.ConstantPool=L},function(t,e){"use strict";var n=function(){function t(){this.queue=[]}return t.prototype.tryLock=function(t,e){return 1===this.queue.push({thread:t,cb:e})},t.prototype.unlock=function(t){var e,n=this.queue.length;for(e=0;e0?this.queue[0].thread:null},t}();e.__esModule=!0,e["default"]=n},function(t,e,n){"use strict";var a=n(8),r=n(13),o=function(){function t(){this.owner=null,this.count=0,this.blocked={},this.waiting={}}return t.prototype.enter=function(t,e){return this.owner===t?(this.count++,!0):this.contendForLock(t,1,a.ThreadStatus.BLOCKED,e)},t.prototype.contendForLock=function(t,e,n,a){var o=this.owner;return r["default"](o!=t,"Thread attempting to contend for lock it already owns!"),null===o?(r["default"](0===this.count),this.owner=t,this.count=e,!0):(this.blocked[t.getRef()]={thread:t,cb:a,count:e},t.setStatus(n,this),!1)},t.prototype.exit=function(t){var e=this.owner;return e===t?0===--this.count&&(this.owner=null,this.appointNewOwner()):t.throwNewException("Ljava/lang/IllegalMonitorStateException;","Cannot exit a monitor that you do not own."),e===t},t.prototype.appointNewOwner=function(){var t=Object.keys(this.blocked);if(t.length>0){var e=t[Math.floor(Math.random()*t.length)],n=this.blocked[e];this.unblock(n.thread,!1)}},t.prototype.wait=function(t,e,n,o){var i=this;return this.getOwner()===t?(r["default"](t.getStatus()!==a.ThreadStatus.BLOCKED),this.waiting[t.getRef()]={thread:t,cb:e,count:this.count,isTimed:null!=n&&0!==n},this.owner=null,this.count=0,null!=n&&0!==n?(this.waiting[t.getRef()].timer=setTimeout(function(){i.unwait(t,!0)},n),t.setStatus(a.ThreadStatus.TIMED_WAITING,this)):t.setStatus(a.ThreadStatus.WAITING,this),this.appointNewOwner(),!0):(t.throwNewException("Ljava/lang/IllegalMonitorStateException;","Cannot wait on an object that you do not own."),!1)},t.prototype.unwait=function(t,e,n,o){void 0===n&&(n=!1),void 0===o&&(o=null);var i=this.waiting[t.getRef()],s=a.ThreadStatus.UNINTERRUPTABLY_BLOCKED,l=function(){t.setStatus(a.ThreadStatus.RUNNABLE),n?o():i.cb(e)};if(r["default"](null!=i),delete this.waiting[t.getRef()],t.getStatus()===a.ThreadStatus.TIMED_WAITING&&!e){var u=i.timer;r["default"](null!=u),clearTimeout(u)}this.contendForLock(t,i.count,s,l)&&l()},t.prototype.unblock=function(t,e){void 0===e&&(e=!1);var n=this.blocked[t.getRef()];r["default"](!e||t.getStatus()===a.ThreadStatus.BLOCKED),null!=n&&(delete this.blocked[t.getRef()],t.setStatus(a.ThreadStatus.RUNNABLE),e||(r["default"](null==this.owner&&0===this.count,"T"+t.getRef()+": We're not interrupting a block, but someone else owns the monitor?! Owned by "+(null==this.owner?"[no one]":""+this.owner.getRef())+" Count: "+this.count),this.owner=t,this.count=n.count,n.cb()))},t.prototype.notify=function(t){if(this.owner===t){var e=Object.keys(this.waiting);e.length>0&&this.unwait(this.waiting[e[Math.floor(Math.random()*e.length)]].thread,!1)}else t.throwNewException("Ljava/lang/IllegalMonitorStateException;","Cannot notify on a monitor that you do not own.")},t.prototype.notifyAll=function(t){if(this.owner===t){var e,n=Object.keys(this.waiting);for(e=0;e0)switch(o[0]){case"%":case"@":continue;case"!":case"#":var i=o.slice(2);n[i]=a={};break;default:"/"===o[o.length-1]&&(o=o.slice(0,o.length-1));var s=o.split("/"),l=a,u=void 0;for(u=0;u0;){var i=a.pop();try{var s=o.statSync(i);if(s.isDirectory())for(var l=o.readdirSync(i),u=0;u0){var n=t._queue[0];o["default"](n.getStatus()===r.ThreadStatus.RUNNABLE,"Attempted to run non-runnable thread."),n.run()}}))},t.prototype.unscheduleThread=function(t){var e=this._queue,n=e[0]===t;o["default"](e.indexOf(t)>-1,"Tried to unschedule thread that was not scheduled."),n?(e.shift(),this._count=0,this.runThread()):e.splice(e.indexOf(t),1)},t.prototype.getRunningThread=function(){var t=this._queue;return t.length>0?t[0]:null},t.prototype.priorityChange=function(t){},t.prototype.quantumOver=function(t){o["default"](this._queue[0]===t,"A non-running thread has an expired quantum?"),this._count++,(this._count>=t.getPriority()||t.getStatus()!==r.ThreadStatus.RUNNABLE)&&(this._count=0,this._queue.push(this._queue.shift())),this.runThread()},t}(),s=function(){function t(t){this.threads=[],this.scheduler=new i,this.emptyCallback=t}return t.prototype.getThreads=function(){return this.threads.slice(0)},t.prototype.anyNonDaemonicThreads=function(){for(var t=0;t=0),this.threads.splice(e,1),!this.anyNonDaemonicThreads()){var n=this.emptyCallback();n&&(this.emptyCallback=null)}},t.prototype.statusChange=function(t,e,n){var o=a(e),i=a(n);e!==r.ThreadStatus.NEW&&e!==r.ThreadStatus.TERMINATED||this.threads.indexOf(t)===-1&&this.threads.push(t),o!==i&&(o?this.scheduler.unscheduleThread(t):this.scheduler.scheduleThread(t)),n===r.ThreadStatus.TERMINATED&&this.threadTerminated(t)},t.prototype.priorityChange=function(t){this.scheduler.priorityChange(t)},t.prototype.quantumOver=function(t){this.scheduler.quantumOver(t)},t}();e.__esModule=!0,e["default"]=s},function(t,e){t.exports={url:"https://github.com/plasma-umass/doppio_jcl/releases/download/v3.2/java_home.tar.gz",classpath:["lib/rt.jar","lib/charsets.jar","lib/doppio.jar","lib/dt.jar","lib/jce.jar","lib/jconsole.jar","lib/jsse.jar","lib/management-agent.jar","lib/resources.jar","lib/sa-jdi.jar","lib/tools.jar"]}},function(module,exports){"use strict";function getGlobalRequire(){var reqVar=eval('typeof(require)!=="undefined"?require:null');return reqVar?reqVar:function(t){throw Error("Cannot find module "+t)}}exports.__esModule=!0,exports["default"]=getGlobalRequire},function(t,e){t.exports={name:"doppiojvm",version:"0.5.0",engine:"node >= 6.0.0",license:"MIT",main:"dist/release/doppio.js",typings:"dist/typings/src/doppiojvm",dependencies:{async:"^2.0.0",browserfs:"^1.0.0",glob:"^7.1.1","gunzip-maybe":"^1.3.1",optimist:"~0.6",pako:"^1.0.3",rimraf:"^2.5.4","source-map-support":"^0.4.3","tar-fs":"^1.13.2"},devDependencies:{"@types/async":"^2.0.32","@types/body-parser":"0.0.33","@types/dropboxjs":"0.0.29","@types/esprima":"^2.1.33","@types/express":"^4.0.33","@types/express-serve-static-core":"^4.0.37","@types/filesystem":"0.0.28","@types/glob":"^5.0.30","@types/grunt":"^0.4.20","@types/jasmine":"^2.5.35","@types/karma":"^0.13.33","@types/node":"6.0.33","@types/rimraf":"0.0.28","@types/semver":"^5.3.30","@types/serve-static":"^1.7.31","@types/source-map":"^0.1.28","@types/uglify-js":"^2.6.28","@types/underscore":"^1.7.33","@types/webpack":"^1.12.35","body-parser":"^1.15.2",cpr:"^2.0.0","detect-browser":"^1.3.1",escodegen:"^1.8.1",esprima:"^3.1.0",estraverse:"^4.2.0",express:"^4.13.4",grunt:"^1.0","grunt-cli":"^1.2","grunt-contrib-compress":"^1.2.0","grunt-contrib-connect":"^1.0","grunt-contrib-copy":"^1.0","grunt-contrib-uglify":"^2.0","grunt-karma":"^2.0","grunt-lineending":"^1.0.0","grunt-merge-source-maps":"^0.1.0","grunt-newer":"^1.2.0","grunt-ts":"6.0.0-beta.3","grunt-webpack":"^1.0.17","imports-loader":"^0.6.5","jasmine-core":"^2.5.2","json-loader":"^0.5.4",karma:"^1.3.0","karma-chrome-launcher":"^2.0","karma-firefox-launcher":"^1.0","karma-ie-launcher":"^1.0","karma-jasmine":"^1.0","karma-opera-launcher":"^1.0","karma-safari-launcher":"^1.0","locate-java-home":"^0.1.6",semver:"^5.3.0","source-map-loader":"^0.1.5",typescript:"^2.0.3","uglify-js":"^2.7.3",underscore:"^1.8.3",webpack:"^1.13.1","webpack-dev-server":"^1.16.2"},scripts:{test:"grunt test",prepublish:"node ./prepublish.js",install:"node ./install.js","appveyor-test":"grunt --stack test-browser-appveyor"},repository:{type:"git",url:"http://github.com/plasma-umass/doppio.git"},bin:{doppio:"./bin/doppio",doppioh:"./bin/doppioh","doppio-dev":"./bin/doppio-dev","doppio-fast-dev":"./bin/doppio-fast-dev"}}},function(module,exports,__webpack_require__){"use strict";function default_1(){var doppio_Debug=function(){function t(){}return t["SetLogLevel(Ldoppio/Debug$LogLevel;)V"]=function(t,e){logging.setLogLevel(e["doppio/Debug$LogLevel/level"])},t["GetLogLevel()Ldoppio/Debug$LogLevel;"]=function(t){var e=t.getBsCl().getInitializedClass(t,"Ldoppio/Debug$LogLevel;").getConstructor(t);switch(logging.logLevel){case LogLevel.VTRACE:return e["doppio/Debug$LogLevel/VTRACE"];case LogLevel.TRACE:return e["doppio/Debug$LogLevel/TRACE"];case LogLevel.DEBUG:return e["doppio/Debug$LogLevel/DEBUG"];default:return e["doppio/Debug$LogLevel/ERROR"]}},t}(),doppio_JavaScript=function(){function doppio_JavaScript(){}return doppio_JavaScript["eval(Ljava/lang/String;)Ljava/lang/String;"]=function(thread,to_eval){try{var rv=eval(""+to_eval);return null!=rv?util.initString(thread.getBsCl(),""+rv):null}catch(e){thread.throwNewException("Ljava/lang/Exception;","Error evaluating string: "+e)}},doppio_JavaScript}(),doppio_security_BrowserPRNG=function(){function t(){}return t["isAvailable()Z"]=function(e){var n=t.crypto;return!(!n||!n.getRandomValues)},t["engineSetSeed([B)V"]=function(t,e,n){t.throwNewException("Ljava/security/ProviderException;","engineSetSeed() failed.")},t["engineNextBytes([B)V"]=function(e,n,a){var r=t.crypto;r.getRandomValues(a.array)},t["engineGenerateSeed(I)[B"]=function(e,n,a){var r=t.crypto,o=util.newArrayFromClass(e,e.getBsCl().getInitializedClass(e,"[B"),a);return r.getRandomValues(o.array),o},t.crypto="undefined"!=typeof crypto?crypto:"undefined"!=typeof msCrypto?msCrypto:null,t}(),doppio_security_NodePRNG=function(){function t(){}return t["isAvailable()Z"]=function(t){return!util.are_in_browser()},t["engineSetSeed([B)V"]=function(t,e,n){t.throwNewException("Ljava/security/ProviderException;","engineSetSeed() failed.")},t["engineNextBytes([B)V"]=function(t,e,n){for(var a=n.array,r=a.length,o=NodeCrypto.randomBytes(r),i=0;i=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(e,this._blockSize-4);var n=this._update(this._block)||this._hash();return t?n.toString(t):n},e.prototype._update=function(){throw Error("_update must be implemented by subclass")},e}},function(t,e,n){var a=n(44).inherits;t.exports=function(t,e){function n(){return d.length?d.pop().init():this instanceof n?(this._w=h,e.call(this,64,56),this._h=null,void this.init()):new n}function r(t,e,n,a){return t<20?e&n|~e&a:t<40?e^n^a:t<60?e&n|e&a|n&a:e^n^a}function o(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}function i(t,e){return t+e|0}function s(t,e){return t<>>32-e}var l=0,u=4,c=8,p=12,f=16,h=new("undefined"==typeof Int32Array?Array:Int32Array)(80),d=[];return a(n,e),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,e.prototype.init.call(this),this},n.prototype._POOL=d,n.prototype._update=function(t){var e,n,a,l,u,c,p,f,h,d;e=c=this._a,n=p=this._b,a=f=this._c,l=h=this._d,u=d=this._e;for(var g=this._w,v=0;v<80;v++){var m=g[v]=v<16?t.readInt32BE(4*v):s(g[v-3]^g[v-8]^g[v-14]^g[v-16],1),_=i(i(s(e,5),r(v,n,a,l)),i(i(u,m),o(v)));u=l,l=a,a=s(n,30),n=e,e=_}this._a=i(e,c),this._b=i(n,p),this._c=i(a,f),this._d=i(l,h),this._e=i(u,d)},n.prototype._hash=function(){d.length<100&&d.push(this);var e=new t(20);return e.writeInt32BE(0|this._a,l),e.writeInt32BE(0|this._b,u),e.writeInt32BE(0|this._c,c),e.writeInt32BE(0|this._d,p),e.writeInt32BE(0|this._e,f),e},n}},function(t,e,n){(function(t,a){function r(t,n){var a={seen:[],stylize:i};return arguments.length>=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),g(n)?a.showHidden=n:n&&e._extend(a,n),E(a.showHidden)&&(a.showHidden=!1),E(a.depth)&&(a.depth=2),E(a.colors)&&(a.colors=!1),E(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=o),l(a,t,a.depth)}function o(t,e){var n=r.styles[e];return n?"["+r.colors[n][0]+"m"+t+"["+r.colors[n][1]+"m":t}function i(t,e){return t}function s(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function l(t,n,a){if(t.customInspect&&n&&S(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var r=n.inspect(a,t);return I(r)||(r=l(t,r,a)),r}var o=u(t,n);if(o)return o;var i=Object.keys(n),g=s(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(n)),C(n)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return c(n);if(0===i.length){if(S(n)){var v=n.name?": "+n.name:"";return t.stylize("[Function"+v+"]","special")}if(L(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(N(n))return t.stylize(Date.prototype.toString.call(n),"date");if(C(n))return c(n)}var m="",_=!1,y=["{","}"];if(d(n)&&(_=!0,y=["[","]"]),S(n)){var E=n.name?": "+n.name:"";m=" [Function"+E+"]"}if(L(n)&&(m=" "+RegExp.prototype.toString.call(n)),N(n)&&(m=" "+Date.prototype.toUTCString.call(n)),C(n)&&(m=" "+c(n)),0===i.length&&(!_||0==n.length))return y[0]+m+y[1];if(a<0)return L(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var T;return T=_?p(t,n,a,g,i):i.map(function(e){return f(t,n,a,g,e,_)}),t.seen.pop(),h(T,m,y)}function u(t,e){if(E(e))return t.stylize("undefined","undefined");if(I(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return _(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,a,r){for(var o=[],i=0,s=e.length;i-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),E(i)){if(o&&r.match(/^\d+$/))return s;i=JSON.stringify(""+r),i.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2), i=t.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=t.stylize(i,"string"))}return i+": "+s}function h(t,e,n){var a=0,r=t.reduce(function(t,e){return a++,e.indexOf("\n")>=0&&a++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function d(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function v(t){return null===t}function m(t){return null==t}function _(t){return"number"==typeof t}function I(t){return"string"==typeof t}function y(t){return"symbol"==typeof t}function E(t){return void 0===t}function L(t){return T(t)&&"[object RegExp]"===A(t)}function T(t){return"object"==typeof t&&null!==t}function N(t){return T(t)&&"[object Date]"===A(t)}function C(t){return T(t)&&("[object Error]"===A(t)||t instanceof Error)}function S(t){return"function"==typeof t}function b(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function A(t){return Object.prototype.toString.call(t)}function w(t){return t<10?"0"+t.toString(10):t.toString(10)}function j(){var t=new Date,e=[w(t.getHours()),w(t.getMinutes()),w(t.getSeconds())].join(":");return[t.getDate(),D[t.getMonth()],e].join(" ")}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;e.format=function(t){if(!I(t)){for(var e=[],n=0;n=o)return t;switch(t){case"%s":return a[n++]+"";case"%d":return+a[n++];case"%j":try{return JSON.stringify(a[n++])}catch(_){return"[Circular]"}default:return t}}),s=a[n];n>>e|t<<32-e}function o(t,e){return t>>>e}function i(t,e,n){return t&e^~t&n}function s(t,e,n){return t&e^t&n^e&n}function l(t){return r(t,2)^r(t,13)^r(t,22)}function u(t){return r(t,6)^r(t,11)^r(t,25)}function c(t){return r(t,7)^r(t,18)^o(t,3)}function p(t){return r(t,17)^r(t,19)^o(t,10)}var f=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=Array(64);return a(n,e),n.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this._len=this._s=0,this},n.prototype._update=function(t){var e,n,a,r,o,h,d,g,v,m,_=this._w;e=0|this._a,n=0|this._b,a=0|this._c,r=0|this._d,o=0|this._e,h=0|this._f,d=0|this._g,g=0|this._h;for(var I=0;I<64;I++){var y=_[I]=I<16?t.readInt32BE(4*I):p(_[I-2])+_[I-7]+c(_[I-15])+_[I-16];v=g+u(o)+i(o,h,d)+f[I]+y,m=l(e)+s(e,n,a),g=d,d=h,h=o,o=r+v,r=a,a=n,n=e,e=v+m}this._a=e+this._a|0,this._b=n+this._b|0,this._c=a+this._c|0,this._d=r+this._d|0,this._e=o+this._e|0,this._f=h+this._f|0,this._g=d+this._g|0,this._h=g+this._h|0},n.prototype._hash=function(){var e=new t(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},n}},function(t,e,n){var a=n(44).inherits;t.exports=function(t,e){function n(){this.init(),this._w=l,e.call(this,128,112)}function r(t,e,n){return t>>>n|e<<32-n}function o(t,e,n){return t&e^~t&n}function i(t,e,n){return t&e^t&n^e&n}var s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],l=Array(160);return a(n,e),n.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this._al=-205731576,this._bl=-2067093701,this._cl=-23791573,this._dl=1595750129,this._el=-1377402159,this._fl=725511199,this._gl=-79577749,this._hl=327033209,this._len=this._s=0,this},n.prototype._update=function(t){var e,n,a,l,u,c,p,f,h,d,g,v,m,_,I,y,E=this._w;e=0|this._a,n=0|this._b,a=0|this._c,l=0|this._d,u=0|this._e,c=0|this._f,p=0|this._g,f=0|this._h,h=0|this._al,d=0|this._bl,g=0|this._cl,v=0|this._dl,m=0|this._el,_=0|this._fl,I=0|this._gl,y=0|this._hl;for(var L=0;L<80;L++){var T,N,C=2*L;if(L<16)T=E[C]=t.readInt32BE(4*C),N=E[C+1]=t.readInt32BE(4*C+4);else{var S=E[C-30],b=E[C-30+1],A=r(S,b,1)^r(S,b,8)^S>>>7,w=r(b,S,1)^r(b,S,8)^r(b,S,7);S=E[C-4],b=E[C-4+1];var j=r(S,b,19)^r(b,S,29)^S>>>6,O=r(b,S,19)^r(S,b,29)^r(b,S,6),k=E[C-14],F=E[C-14+1],R=E[C-32],D=E[C-32+1];N=w+F,T=A+k+(N>>>0>>0?1:0),N+=O,T=T+j+(N>>>0>>0?1:0),N+=D,T=T+R+(N>>>0>>0?1:0),E[C]=T,E[C+1]=N}var x=i(e,n,a),M=i(h,d,g),B=r(e,h,28)^r(h,e,2)^r(h,e,7),U=r(h,e,28)^r(e,h,2)^r(e,h,7),P=r(u,m,14)^r(u,m,18)^r(m,u,9),V=r(m,u,14)^r(m,u,18)^r(u,m,9),J=s[C],z=s[C+1],W=o(u,c,p),G=o(m,_,I),H=y+V,Y=f+P+(H>>>0>>0?1:0);H+=G,Y=Y+W+(H>>>0>>0?1:0),H+=z,Y=Y+J+(H>>>0>>0?1:0),H+=N,Y=Y+T+(H>>>0>>0?1:0);var K=U+M,Z=B+x+(K>>>0>>0?1:0);f=p,y=I,p=c,I=_,c=u,_=m,m=v+H|0,u=l+Y+(m>>>0>>0?1:0)|0,l=a,v=g,a=n,g=d,n=e,d=h,h=H+K|0,e=Y+Z+(h>>>0>>0?1:0)|0}this._al=this._al+h|0,this._bl=this._bl+d|0,this._cl=this._cl+g|0,this._dl=this._dl+v|0,this._el=this._el+m|0,this._fl=this._fl+_|0,this._gl=this._gl+I|0,this._hl=this._hl+y|0,this._a=this._a+e+(this._al>>>0>>0?1:0)|0,this._b=this._b+n+(this._bl>>>0>>0?1:0)|0,this._c=this._c+a+(this._cl>>>0>>0?1:0)|0,this._d=this._d+l+(this._dl>>>0>>0?1:0)|0,this._e=this._e+u+(this._el>>>0>>0?1:0)|0,this._f=this._f+c+(this._fl>>>0<_>>>0?1:0)|0,this._g=this._g+p+(this._gl>>>0>>0?1:0)|0,this._h=this._h+f+(this._hl>>>0>>0?1:0)|0},n.prototype._hash=function(){function e(t,e,a){n.writeInt32BE(t,a),n.writeInt32BE(e,a+4)}var n=new t(64);return e(this._a,this._al,0),e(this._b,this._bl,8),e(this._c,this._cl,16),e(this._d,this._dl,24),e(this._e,this._el,32),e(this._f,this._fl,40),e(this._g,this._gl,48),e(this._h,this._hl,56),n},n}},function(t,e,n){function a(t,e){t[e>>5]|=128<>>9<<4)+14]=e;for(var n=1732584193,a=-271733879,r=-1732584194,c=271733878,p=0;p>16)+(e>>16)+(n>>16);return a<<16|65535&n}function c(t,e){return t<>>32-e}var p=n(50);t.exports=function(t){return p.hash(t,a,16)}},function(t,e,n){(function(e){function n(t,n){if(t.length%o!==0){var a=t.length+(o-t.length%o);t=e.concat([t,i],a)}for(var r=[],s=n?t.readInt32BE:t.readInt32LE,l=0;l>>32-e}function l(t){var n=[1732584193,4023233417,2562383102,271733878,3285377520];"string"==typeof t&&(t=new e(t,"utf8"));var a=g(t),r=8*t.length,o=8*t.length;a[r>>>5]|=128<<24-r%32,a[(r+64>>>9<<4)+14]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);for(var i=0;i>>24)|4278255360&(s<<24|s>>>8)}var l=v(n);return new e(l)}t.exports=l;/** @preserve (c) 2012 by Cédric Mesnil. All rights reserved. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f600a27..4990252b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,7 +27,7 @@ patchedDependencies: hash: 298d43ad26f589e1a61d6e04912575cc6fab3fda3cd533a274fc353b5de5862e path: patches/browserfs@1.4.3.patch doppiojvm@0.5.0: - hash: 614d81e33db7769f5c9c06b22a82481109af374ce1d50744db7f2cf6b310748e + hash: 39e5a394b9ac3f9fe0638715c090d20b8bdecd35639cf4fca3adfb6024f3b66a path: patches/doppiojvm@0.5.0.patch importers: @@ -271,7 +271,7 @@ importers: version: 1.4.3(patch_hash=298d43ad26f589e1a61d6e04912575cc6fab3fda3cd533a274fc353b5de5862e) doppiojvm: specifier: ^0.5.0 - version: 0.5.0(patch_hash=614d81e33db7769f5c9c06b22a82481109af374ce1d50744db7f2cf6b310748e) + version: 0.5.0(patch_hash=39e5a394b9ac3f9fe0638715c090d20b8bdecd35639cf4fca3adfb6024f3b66a) libs: specifier: workspace:* version: link:../libs @@ -4115,7 +4115,7 @@ snapshots: optionalDependencies: '@types/trusted-types': 2.0.7 - doppiojvm@0.5.0(patch_hash=614d81e33db7769f5c9c06b22a82481109af374ce1d50744db7f2cf6b310748e): + doppiojvm@0.5.0(patch_hash=39e5a394b9ac3f9fe0638715c090d20b8bdecd35639cf4fca3adfb6024f3b66a): dependencies: async: 2.6.4 browserfs: 1.4.3(patch_hash=298d43ad26f589e1a61d6e04912575cc6fab3fda3cd533a274fc353b5de5862e)