List of usage examples for org.objectweb.asm Opcodes ACONST_NULL
int ACONST_NULL
To view the source code for org.objectweb.asm Opcodes ACONST_NULL.
Click Source Link
From source file:com.yahoo.yqlplus.engine.internal.bytecode.CodeEmitterTest.java
@Test public void requireFloatAdd() throws Exception { UnitGenerator unit = new UnitGenerator("foo", source); unit.addInterface(Callable.class); MethodGenerator gen = unit.createMethod("call"); gen.setReturnType(AnyTypeWidget.getInstance()); final BytecodeExpression leftExpr = source.constant(1); final BytecodeExpression rightExpr = source.constant(1.0f); gen.add(new BytecodeSequence() { @Override// w ww .j a v a 2 s .c o m public void generate(CodeEmitter code) { Label hasNull = new Label(); CodeEmitter.Unification unify = code.unifiedEmit(leftExpr, rightExpr, hasNull); code.getMethodVisitor().visitInsn(Opcodes.DADD); code.box(BaseTypeAdapter.FLOAT64); code.getMethodVisitor().visitInsn(Opcodes.ARETURN); if (unify.nullPossible) { code.getMethodVisitor().visitLabel(hasNull); code.getMethodVisitor().visitInsn(Opcodes.ACONST_NULL); code.getMethodVisitor().visitInsn(Opcodes.ARETURN); } } }); source.build(); Class<? extends Callable> clazz = (Class<? extends Callable>) source.getGeneratedClass(unit); Callable c = clazz.newInstance(); Assert.assertEquals(2.0, c.call()); }
From source file:com.yahoo.yqlplus.engine.internal.bytecode.CodeEmitterTest.java
@Test public void requireBoxedAdd() throws Exception { UnitGenerator unit = new UnitGenerator("foo", source); unit.addInterface(Callable.class); MethodGenerator gen = unit.createMethod("call"); gen.setReturnType(AnyTypeWidget.getInstance()); final BytecodeExpression leftExpr = source.constant(BaseTypeAdapter.INT32.boxed(), 1); final BytecodeExpression rightExpr = source.constant(1.0f); gen.add(new BytecodeSequence() { @Override//from w w w . ja va 2 s .c o m public void generate(CodeEmitter code) { Label hasNull = new Label(); CodeEmitter.Unification unify = code.unifiedEmit(leftExpr, rightExpr, hasNull); code.getMethodVisitor().visitInsn(Opcodes.DADD); code.box(BaseTypeAdapter.FLOAT64); code.getMethodVisitor().visitInsn(Opcodes.ARETURN); if (unify.nullPossible) { code.getMethodVisitor().visitLabel(hasNull); code.getMethodVisitor().visitInsn(Opcodes.ACONST_NULL); code.getMethodVisitor().visitInsn(Opcodes.ARETURN); } } }); source.build(); Class<? extends Callable> clazz = (Class<? extends Callable>) source.getGeneratedClass(unit); Callable c = clazz.newInstance(); Assert.assertEquals(2.0, c.call()); }
From source file:com.yahoo.yqlplus.engine.internal.bytecode.CodeEmitterTest.java
@Test public void requireBoxedNull() throws Exception { UnitGenerator unit = new UnitGenerator("foo", source); unit.addInterface(Callable.class); MethodGenerator gen = unit.createMethod("call"); gen.setReturnType(AnyTypeWidget.getInstance()); final BytecodeExpression rightExpr = source.constant(1.0f); gen.add(new BytecodeSequence() { @Override/*from w ww. j ava 2s.co m*/ public void generate(CodeEmitter code) { Label hasNull = new Label(); CodeEmitter.Unification unify = code.unifiedEmit(new NullExpr(BaseTypeAdapter.INT32.boxed()), rightExpr, hasNull); code.getMethodVisitor().visitInsn(Opcodes.DADD); code.box(BaseTypeAdapter.FLOAT64); code.getMethodVisitor().visitInsn(Opcodes.ARETURN); if (unify.nullPossible) { code.getMethodVisitor().visitLabel(hasNull); code.getMethodVisitor().visitInsn(Opcodes.ACONST_NULL); code.getMethodVisitor().visitInsn(Opcodes.ARETURN); } } }); source.build(); Class<? extends Callable> clazz = (Class<? extends Callable>) source.getGeneratedClass(unit); Callable c = clazz.newInstance(); Assert.assertNull(c.call()); }
From source file:com.yahoo.yqlplus.engine.internal.bytecode.exprs.NullExpr.java
@Override public void generate(CodeEmitter code) { // VOID, BOOLEAN, CHAR, BYTE, SHORT, INT, FLOAT, LONG, DOUBLE, ARRAY, OBJECT or METHOD. int opcode;//w w w .j a va 2 s. c o m switch (getType().getJVMType().getSort()) { case Type.VOID: case Type.METHOD: throw new UnsupportedOperationException("Unsupported NullExpr type: " + getType()); case Type.BOOLEAN: case Type.SHORT: case Type.INT: case Type.CHAR: opcode = Opcodes.ICONST_0; break; case Type.FLOAT: opcode = Opcodes.FCONST_0; break; case Type.LONG: opcode = Opcodes.LCONST_0; break; case Type.DOUBLE: opcode = Opcodes.DCONST_0; break; case Type.ARRAY: case Type.OBJECT: opcode = Opcodes.ACONST_NULL; break; default: throw new UnsupportedOperationException("Unknown NullExpr type: " + getType()); } code.getMethodVisitor().visitInsn(opcode); if (opcode == Opcodes.ACONST_NULL) { code.cast(getType(), AnyTypeWidget.getInstance()); } }
From source file:com.yahoo.yqlplus.engine.internal.bytecode.types.gambit.ExpressionHandler.java
@Override public BytecodeExpression coalesce(Location loc, final List<BytecodeExpression> inputs) { List<TypeWidget> widgets = Lists.newArrayList(); for (BytecodeExpression expr : inputs) { widgets.add(expr.getType());/*www . j a v a 2 s . c o m*/ } TypeWidget output = unify(widgets); return new BaseTypeExpression(output) { @Override public void generate(CodeEmitter code) { Label done = new Label(); MethodVisitor mv = code.getMethodVisitor(); boolean lastNullable = true; for (BytecodeExpression expr : inputs) { Label isNull = new Label(); code.exec(expr); if (code.cast(getType(), expr.getType(), isNull)) { mv.visitJumpInsn(Opcodes.GOTO, done); mv.visitLabel(isNull); } else { lastNullable = false; break; } } if (lastNullable) { mv.visitInsn(Opcodes.ACONST_NULL); } mv.visitLabel(done); } }; }
From source file:com.yahoo.yqlplus.engine.internal.compiler.BytecodeArithmeticExpression.java
@Override public void generate(CodeEmitter code) { MethodVisitor mv = code.getMethodVisitor(); Label isNull = new Label(); TypeWidget mathType = getType().unboxed(); if (!mathType.isPrimitive() || op == ArithmeticOperation.POW) { mv.visitFieldInsn(Opcodes.GETSTATIC, Type.getInternalName(Maths.class), "INSTANCE", Type.getDescriptor(Maths.class)); mv.visitFieldInsn(Opcodes.GETSTATIC, Type.getInternalName(ArithmeticOperation.class), op.name(), Type.getDescriptor(ArithmeticOperation.class)); }//from ww w . j av a 2s. c om CodeEmitter.Unification out = code.unifyAs(mathType, leftExpr, rightExpr, isNull, isNull, isNull); // now we have both sides unified as (if possible) a primitive type // compute the result if (mathType.isPrimitive()) { switch (op) { case ADD: mv.visitInsn(mathType.getJVMType().getOpcode(Opcodes.IADD)); break; case SUB: mv.visitInsn(mathType.getJVMType().getOpcode(Opcodes.ISUB)); break; case MULT: mv.visitInsn(mathType.getJVMType().getOpcode(Opcodes.IMUL)); break; case DIV: mv.visitInsn(mathType.getJVMType().getOpcode(Opcodes.IDIV)); break; case MOD: mv.visitInsn(mathType.getJVMType().getOpcode(Opcodes.IREM)); break; case POW: mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, Type.getInternalName(Maths.class), "binaryMath", Type.getMethodDescriptor(mathType.getJVMType(), Type.getType(ArithmeticOperation.class), mathType.getJVMType(), mathType.getJVMType()), false); break; default: throw new ProgramCompileException(loc, "Unknown BinaryMath operation: " + op); } } else if (mathType.getValueCoreType() == YQLCoreType.ANY) { String desc = Type.getMethodDescriptor(getType().getJVMType(), Type.getType(Maths.class), Type.getType(ArithmeticOperation.class), leftExpr.getType().boxed().getJVMType(), rightExpr.getType().boxed().getJVMType()); mv.visitInvokeDynamicInsn("dyn:callMethod:binaryMath", desc, Dynamic.H_DYNALIB_BOOTSTRAP); } else { throw new ProgramCompileException(loc, "Math operation %s is not defined for type %s", op, mathType.getJVMType()); } if (!getType().isPrimitive() && mathType.isPrimitive()) { code.box(mathType); } if (out.nullPossible) { Label done = new Label(); mv.visitJumpInsn(Opcodes.GOTO, done); mv.visitLabel(isNull); if (!mathType.isPrimitive() || op == ArithmeticOperation.POW) { mv.visitInsn(Opcodes.POP2); } mv.visitInsn(Opcodes.ACONST_NULL); mv.visitLabel(done); } }
From source file:com.yahoo.yqlplus.engine.internal.compiler.BytecodeNegateExpression.java
@Override public void generate(CodeEmitter code) { MethodVisitor mv = code.getMethodVisitor(); Label isNull = new Label(); TypeWidget mathType = getType().unboxed(); if (!mathType.isPrimitive()) { mv.visitFieldInsn(Opcodes.GETSTATIC, Type.getInternalName(Maths.class), "INSTANCE", Type.getDescriptor(Maths.class)); }//ww w.ja v a 2s .c om boolean maybeNull = code.cast(mathType, leftExpr.getType(), isNull); // compute the result if (mathType.isPrimitive()) { mv.visitInsn(mathType.getJVMType().getOpcode(Opcodes.INEG)); } else if (mathType.getValueCoreType() == YQLCoreType.ANY) { String desc = Type.getMethodDescriptor(getType().getJVMType(), Type.getType(Maths.class), leftExpr.getType().getJVMType()); mv.visitInvokeDynamicInsn("dyn:callMethod:negate", desc, Dynamic.H_DYNALIB_BOOTSTRAP); } else { throw new ProgramCompileException(loc, "Math operation NEGATE is not defined for type %s", mathType.getJVMType()); } if (!getType().isPrimitive() && mathType.isPrimitive()) { code.box(mathType); } if (maybeNull) { Label done = new Label(); mv.visitJumpInsn(Opcodes.GOTO, done); mv.visitLabel(isNull); mv.visitInsn(Opcodes.ACONST_NULL); mv.visitLabel(done); } }
From source file:com.yahoo.yqlplus.engine.internal.plan.types.base.ArrayIndexAdapter.java
@Override public BytecodeExpression first(final BytecodeExpression target) { // what should this return if the array is of length 0? return new BaseTypeExpression(NullableTypeWidget.create(valueType.boxed())) { @Override/* w w w. j ava 2 s .com*/ public void generate(CodeEmitter start) { CodeEmitter code = start.createScope(); Label done = new Label(); Label isNull = new Label(); MethodVisitor mv = code.getMethodVisitor(); BytecodeExpression tgt = code.evaluateOnce(target); code.exec(tgt); code.nullTest(tgt.getType(), isNull); mv.visitInsn(Opcodes.ARRAYLENGTH); mv.visitJumpInsn(Opcodes.IFEQ, isNull); code.exec(tgt); code.emitIntConstant(0); mv.visitInsn(ownerType.getJVMType().getOpcode(Opcodes.IALOAD)); code.cast(valueType.boxed(), valueType, isNull); mv.visitJumpInsn(Opcodes.GOTO, done); mv.visitLabel(isNull); mv.visitInsn(Opcodes.ACONST_NULL); mv.visitLabel(done); code.endScope(); } }; }
From source file:com.yahoo.yqlplus.engine.internal.plan.types.base.IterateFirstSequence.java
@Override public void generate(CodeEmitter start) { CodeEmitter code = start.createScope(); Label done = new Label(); Label isNull = new Label(); MethodVisitor mv = code.getMethodVisitor(); BytecodeExpression tgt = code.evaluateOnce(target); tgt.generate(code);//from ww w. ja v a2s . c o m code.emitInstanceCheck(tgt.getType(), Iterable.class, isNull); AssignableValue iterator = code.allocate(Iterator.class); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, Type.getInternalName(Iterable.class), "iterator", Type.getMethodDescriptor(Type.getType(Iterator.class)), true); code.exec(iterator.write(code.adapt(Iterator.class))); code.exec(iterator.read()); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, Type.getInternalName(Iterator.class), "hasNext", Type.getMethodDescriptor(Type.BOOLEAN_TYPE), true); mv.visitJumpInsn(Opcodes.IFEQ, isNull); code.exec(iterator.read()); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, Type.getInternalName(Iterator.class), "next", Type.getMethodDescriptor(Type.getType(Object.class)), true); code.cast(valueType, AnyTypeWidget.getInstance(), isNull); mv.visitJumpInsn(Opcodes.GOTO, done); mv.visitLabel(isNull); mv.visitInsn(Opcodes.ACONST_NULL); mv.visitLabel(done); }
From source file:de.dynamicfiles.projects.gradle.plugins.javafx.tasks.internal.MonkeyPatcher.java
License:Apache License
private static void doMonkeyPatchFileHandleLeak(ClassReader classReader, ClassWriter classWriter) { classReader.accept(new ClassVisitor(Opcodes.ASM5, classWriter) { @Override/* w ww.j a v a2 s .c o m*/ public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { if (!(name.equals(METHOD_TO_MONKEY_PATCH) && desc.equals(METHOD_SIGNATURE_TO_MONKEY_PATCH))) { return super.visitMethod(access, name, desc, signature, exceptions); } // helpful source: http://web.cs.ucla.edu/~msb/cs239-tutorial/ // "We will do this using the Adapter Pattern. Adapters wrap an object, overriding some of its methods, and delegating to the others." // ugly adapter-pattern ... took me more time than I really can tell here <.< return getMonkeyPatchedFileHandleLeakMethodVisitor(access, name, desc, signature, exceptions); } private MethodVisitor getMonkeyPatchedFileHandleLeakMethodVisitor(int access, String name, String desc, String signature, String[] exceptions) { return new MethodVisitor(Opcodes.ASM5, super.visitMethod(access, name, desc, signature, exceptions)) { /* TODO improve detection of lambda-positions, numbers might vary on different compile-versions */ @Override public void visitCode() { // This mostly got generated from ASM itself, except some adjustments for lambda-IDs and removed "visitMaxs()"-call String javalangThrowable = "java/lang/Throwable"; String javaioFile = "java/io/File"; String javalangString = "java/lang/String"; Label l0 = new Label(); Label l1 = new Label(); Label l2 = new Label(); mv.visitTryCatchBlock(l0, l1, l2, javalangThrowable); Label l3 = new Label(); Label l4 = new Label(); Label l5 = new Label(); mv.visitTryCatchBlock(l3, l4, l5, javalangThrowable); Label l6 = new Label(); mv.visitTryCatchBlock(l3, l4, l6, null); Label l7 = new Label(); Label l8 = new Label(); Label l9 = new Label(); mv.visitTryCatchBlock(l7, l8, l9, javalangThrowable); Label l10 = new Label(); mv.visitTryCatchBlock(l5, l10, l6, null); mv.visitInsn(Opcodes.ACONST_NULL); mv.visitVarInsn(Opcodes.ASTORE, 3); mv.visitVarInsn(Opcodes.ALOAD, 2); Label l11 = new Label(); mv.visitJumpInsn(Opcodes.IFNULL, l11); mv.visitVarInsn(Opcodes.ALOAD, 2); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, javaioFile, "isDirectory", "()Z", false); Label l12 = new Label(); mv.visitJumpInsn(Opcodes.IFNE, l12); mv.visitLabel(l11); mv.visitFrame(Opcodes.F_APPEND, 1, new Object[] { javalangString }, 0, null); mv.visitTypeInsn(Opcodes.NEW, javaioFile); mv.visitInsn(Opcodes.DUP); mv.visitLdcInsn("java.home"); mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/System", "getProperty", "(Ljava/lang/String;)Ljava/lang/String;", false); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, javaioFile, "<init>", "(Ljava/lang/String;)V", false); mv.visitVarInsn(Opcodes.ASTORE, 2); mv.visitLabel(l12); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitFieldInsn(Opcodes.GETSTATIC, "com/oracle/tools/packager/windows/WinAppBundler", "VS_VERS", "[Ljava/lang/String;"); mv.visitVarInsn(Opcodes.ASTORE, 4); mv.visitVarInsn(Opcodes.ALOAD, 4); mv.visitInsn(Opcodes.ARRAYLENGTH); mv.visitVarInsn(Opcodes.ISTORE, 5); mv.visitInsn(Opcodes.ICONST_0); mv.visitVarInsn(Opcodes.ISTORE, 6); Label l13 = new Label(); mv.visitLabel(l13); mv.visitFrame(Opcodes.F_APPEND, 3, new Object[] { "[Ljava/lang/String;", Opcodes.INTEGER, Opcodes.INTEGER }, 0, null); mv.visitVarInsn(Opcodes.ILOAD, 6); mv.visitVarInsn(Opcodes.ILOAD, 5); Label l14 = new Label(); mv.visitJumpInsn(Opcodes.IF_ICMPGE, l14); mv.visitVarInsn(Opcodes.ALOAD, 4); mv.visitVarInsn(Opcodes.ILOAD, 6); mv.visitInsn(Opcodes.AALOAD); mv.visitVarInsn(Opcodes.ASTORE, 7); mv.visitVarInsn(Opcodes.ALOAD, 0); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitVarInsn(Opcodes.ALOAD, 7); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "com/oracle/tools/packager/windows/WinAppBundler", "copyMSVCDLLs", "(Ljava/io/File;Ljava/lang/String;)Z", false); Label l15 = new Label(); mv.visitJumpInsn(Opcodes.IFEQ, l15); mv.visitVarInsn(Opcodes.ALOAD, 7); mv.visitVarInsn(Opcodes.ASTORE, 3); mv.visitJumpInsn(Opcodes.GOTO, l14); mv.visitLabel(l15); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitIincInsn(6, 1); mv.visitJumpInsn(Opcodes.GOTO, l13); mv.visitLabel(l14); mv.visitFrame(Opcodes.F_CHOP, 3, null, 0, null); mv.visitVarInsn(Opcodes.ALOAD, 3); Label l16 = new Label(); mv.visitJumpInsn(Opcodes.IFNONNULL, l16); mv.visitTypeInsn(Opcodes.NEW, "java/lang/RuntimeException"); mv.visitInsn(Opcodes.DUP); mv.visitLdcInsn("Not found MSVC dlls"); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/RuntimeException", "<init>", "(Ljava/lang/String;)V", false); mv.visitInsn(Opcodes.ATHROW); mv.visitLabel(l16); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitTypeInsn(Opcodes.NEW, "java/util/concurrent/atomic/AtomicReference"); mv.visitInsn(Opcodes.DUP); mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/util/concurrent/atomic/AtomicReference", "<init>", "()V", false); mv.visitVarInsn(Opcodes.ASTORE, 4); mv.visitVarInsn(Opcodes.ALOAD, 3); mv.visitVarInsn(Opcodes.ASTORE, 5); mv.visitVarInsn(Opcodes.ALOAD, 2); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, javaioFile, "toPath", "()Ljava/nio/file/Path;", false); mv.visitLdcInsn("bin"); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/nio/file/Path", "resolve", "(Ljava/lang/String;)Ljava/nio/file/Path;", true); mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/nio/file/Files", "list", "(Ljava/nio/file/Path;)Ljava/util/stream/Stream;", false); mv.visitVarInsn(Opcodes.ASTORE, 6); mv.visitInsn(Opcodes.ACONST_NULL); mv.visitVarInsn(Opcodes.ASTORE, 7); mv.visitLabel(l3); mv.visitVarInsn(Opcodes.ALOAD, 6); mv.visitInvokeDynamicInsn("test", "()Ljava/util/function/Predicate;", new Handle( Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"), new Object[] { Type.getType("(Ljava/lang/Object;)Z"), new Handle(Opcodes.H_INVOKESTATIC, "com/oracle/tools/packager/windows/WinAppBundler", "lambda$copyMSVCDLLs$261", "(Ljava/nio/file/Path;)Z"), Type.getType("(Ljava/nio/file/Path;)Z") }); // modified lambda-name mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/stream/Stream", "filter", "(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;", true); mv.visitVarInsn(Opcodes.ALOAD, 5); mv.visitInvokeDynamicInsn("test", "(Ljava/lang/String;)Ljava/util/function/Predicate;", new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"), new Object[] { Type.getType("(Ljava/lang/Object;)Z"), new Handle( Opcodes.H_INVOKESTATIC, "com/oracle/tools/packager/windows/WinAppBundler", "lambda$copyMSVCDLLs$262", "(Ljava/lang/String;Ljava/nio/file/Path;)Z"), Type.getType("(Ljava/nio/file/Path;)Z") }); // modified lambda-name mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/stream/Stream", "filter", "(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;", true); mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitVarInsn(Opcodes.ALOAD, 4); mv.visitInvokeDynamicInsn("accept", "(Ljava/io/File;Ljava/util/concurrent/atomic/AtomicReference;)Ljava/util/function/Consumer;", new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory", "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"), new Object[] { Type.getType("(Ljava/lang/Object;)V"), new Handle( Opcodes.H_INVOKESTATIC, "com/oracle/tools/packager/windows/WinAppBundler", "lambda$copyMSVCDLLs$263", "(Ljava/io/File;Ljava/util/concurrent/atomic/AtomicReference;Ljava/nio/file/Path;)V"), Type.getType("(Ljava/nio/file/Path;)V") }); // modified lambda-name mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/stream/Stream", "forEach", "(Ljava/util/function/Consumer;)V", true); mv.visitLabel(l4); mv.visitVarInsn(Opcodes.ALOAD, 6); Label l17 = new Label(); mv.visitJumpInsn(Opcodes.IFNULL, l17); mv.visitVarInsn(Opcodes.ALOAD, 7); Label l18 = new Label(); mv.visitJumpInsn(Opcodes.IFNULL, l18); mv.visitLabel(l0); mv.visitVarInsn(Opcodes.ALOAD, 6); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/stream/Stream", "close", "()V", true); mv.visitLabel(l1); mv.visitJumpInsn(Opcodes.GOTO, l17); mv.visitLabel(l2); mv.visitFrame(Opcodes.F_FULL, 8, new Object[] { "com/oracle/tools/packager/windows/WinAppBundler", javaioFile, javaioFile, javalangString, "java/util/concurrent/atomic/AtomicReference", javalangString, "java/util/stream/Stream", javalangThrowable }, 1, new Object[] { javalangThrowable }); mv.visitVarInsn(Opcodes.ASTORE, 8); mv.visitVarInsn(Opcodes.ALOAD, 7); mv.visitVarInsn(Opcodes.ALOAD, 8); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, javalangThrowable, "addSuppressed", "(Ljava/lang/Throwable;)V", false); mv.visitJumpInsn(Opcodes.GOTO, l17); mv.visitLabel(l18); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitVarInsn(Opcodes.ALOAD, 6); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/stream/Stream", "close", "()V", true); mv.visitJumpInsn(Opcodes.GOTO, l17); mv.visitLabel(l5); mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] { javalangThrowable }); mv.visitVarInsn(Opcodes.ASTORE, 8); mv.visitVarInsn(Opcodes.ALOAD, 8); mv.visitVarInsn(Opcodes.ASTORE, 7); mv.visitVarInsn(Opcodes.ALOAD, 8); mv.visitInsn(Opcodes.ATHROW); mv.visitLabel(l6); mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] { javalangThrowable }); mv.visitVarInsn(Opcodes.ASTORE, 9); mv.visitLabel(l10); mv.visitVarInsn(Opcodes.ALOAD, 6); Label l19 = new Label(); mv.visitJumpInsn(Opcodes.IFNULL, l19); mv.visitVarInsn(Opcodes.ALOAD, 7); Label l20 = new Label(); mv.visitJumpInsn(Opcodes.IFNULL, l20); mv.visitLabel(l7); mv.visitVarInsn(Opcodes.ALOAD, 6); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/stream/Stream", "close", "()V", true); mv.visitLabel(l8); mv.visitJumpInsn(Opcodes.GOTO, l19); mv.visitLabel(l9); mv.visitFrame(Opcodes.F_FULL, 10, new Object[] { "com/oracle/tools/packager/windows/WinAppBundler", javaioFile, javaioFile, javalangString, "java/util/concurrent/atomic/AtomicReference", javalangString, "java/util/stream/Stream", javalangThrowable, Opcodes.TOP, javalangThrowable }, 1, new Object[] { javalangThrowable }); mv.visitVarInsn(Opcodes.ASTORE, 10); mv.visitVarInsn(Opcodes.ALOAD, 7); mv.visitVarInsn(Opcodes.ALOAD, 10); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, javalangThrowable, "addSuppressed", "(Ljava/lang/Throwable;)V", false); mv.visitJumpInsn(Opcodes.GOTO, l19); mv.visitLabel(l20); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitVarInsn(Opcodes.ALOAD, 6); mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/stream/Stream", "close", "()V", true); mv.visitLabel(l19); mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); mv.visitVarInsn(Opcodes.ALOAD, 9); mv.visitInsn(Opcodes.ATHROW); mv.visitLabel(l17); mv.visitFrame(Opcodes.F_FULL, 6, new Object[] { "com/oracle/tools/packager/windows/WinAppBundler", javaioFile, javaioFile, javalangString, "java/util/concurrent/atomic/AtomicReference", javalangString }, 0, new Object[] {}); mv.visitVarInsn(Opcodes.ALOAD, 4); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/util/concurrent/atomic/AtomicReference", "get", "()Ljava/lang/Object;", false); mv.visitTypeInsn(Opcodes.CHECKCAST, "java/io/IOException"); mv.visitVarInsn(Opcodes.ASTORE, 6); mv.visitVarInsn(Opcodes.ALOAD, 6); Label l21 = new Label(); mv.visitJumpInsn(Opcodes.IFNULL, l21); mv.visitVarInsn(Opcodes.ALOAD, 6); mv.visitInsn(Opcodes.ATHROW); mv.visitLabel(l21); mv.visitFrame(Opcodes.F_APPEND, 1, new Object[] { "java/io/IOException" }, 0, null); mv.visitInsn(Opcodes.RETURN); } }; } }, ClassReader.EXPAND_FRAMES); // ClassReader.EXPAND_FRAMES required for Java 8 }