private void _writeOutFinally(BytecodeContext bc, int lRef) throws BytecodeException { // ref.remove(pc); // Reference r=null; GeneratorAdapter adapter = bc.getAdapter(); // if(fcf!=null && // fcf.getAfterFinalGOTOLabel()!=null)ASMUtil.visitLabel(adapter,fcf.getFinalEntryLabel()); ExpressionUtil.visitLine(bc, finallyLine); // if (reference != null) // reference.removeEL(pagecontext); Label removeEnd = new Label(); adapter.loadLocal(lRef); adapter.ifNull(removeEnd); adapter.loadLocal(lRef); adapter.loadArg(0); adapter.invokeInterface(Types.REFERENCE, REMOVE_EL); adapter.pop(); adapter.visitLabel(removeEnd); if (finallyBody != null) finallyBody.writeOut(bc); // finally /*if(fcf!=null){ Label l = fcf.getAfterFinalGOTOLabel(); if(l!=null)adapter.visitJumpInsn(Opcodes.GOTO, l); }*/ }
private static void catchBody( BytecodeContext bc, GeneratorAdapter adapter, Catch ct, int pe, int lRef, boolean caugth, boolean store) throws BytecodeException { // pc.setCatch(pe,true); adapter.loadArg(0); adapter.loadLocal(pe); adapter.push(caugth); adapter.push(store); adapter.invokeVirtual(Types.PAGE_CONTEXT, TagTry.SET_CATCH3); // ref= ct.name.writeOut(bc, Expression.MODE_REF); adapter.storeLocal(lRef); adapter.loadLocal(lRef); adapter.loadArg(0); adapter.loadLocal(pe); // (...,pe.getCatchBlock(pc)) adapter.loadArg(0); adapter.invokeVirtual(Types.PAGE_EXCEPTION, GET_CATCH_BLOCK); adapter.invokeInterface(Types.REFERENCE, SET); adapter.pop(); ct.body.writeOut(bc); }
public static void invokeMethod(GeneratorAdapter adapter, Type type, Method method) { if (type.getClass().isInterface()) adapter.invokeInterface(type, method); else adapter.invokeVirtual(type, method); }