@Override
    public void _writeOut(BytecodeContext bc) throws TransformerException {
	final GeneratorAdapter adapter = bc.getAdapter();

	adapter.visitLabel(begin);

	// Reference ref=null;
	final int lRef = adapter.newLocal(Types.REFERENCE);
	adapter.visitInsn(Opcodes.ACONST_NULL);
	adapter.storeLocal(lRef);

	// has no try body, if there is no try body, no catches are executed, only finally
	if (!tryBody.hasStatements()) {
	    if (finallyBody != null) finallyBody.writeOut(bc);
	    return;
	}

	// PageExceptionImpl old=pc.getCatch();
	final int old = adapter.newLocal(Types.PAGE_EXCEPTION);
	adapter.loadArg(0);
	adapter.invokeVirtual(Types.PAGE_CONTEXT, TagTry.GET_CATCH);
	adapter.storeLocal(old);

	TryCatchFinallyVisitor tcfv = new TryCatchFinallyVisitor(new OnFinally() {

	    @Override
	    public void _writeOut(BytecodeContext bc) throws TransformerException {

		adapter.loadArg(0);
		adapter.loadLocal(old);
		adapter.invokeVirtual(Types.PAGE_CONTEXT, TagTry.SET_CATCH_PE);

		_writeOutFinally(bc, lRef);
	    }
	}, getFlowControlFinal());

	// try
	tcfv.visitTryBegin(bc);
	tryBody.writeOut(bc);
	int lThrow = tcfv.visitTryEndCatchBeging(bc);
	_writeOutCatch(bc, lRef, lThrow, old);
	tcfv.visitCatchEnd(bc);

    }
@ Override public void _writeOut ( BytecodeContext bc ) throws TransformerException { final GeneratorAdapter adapter = bc . getAdapter ( ) ; adapter . visitLabel ( begin ) ; final int lRef = adapter . newLocal ( Types . REFERENCE ) ; adapter . visitInsn ( Opcodes . ACONST_NULL ) ; adapter . storeLocal ( lRef ) ; if ( ! tryBody . hasStatements ( ) ) { if ( finallyBody != null ) finallyBody . writeOut ( bc ) ; return ; } final int old = adapter . newLocal ( Types . PAGE_EXCEPTION ) ; adapter . loadArg ( 0 ) ; adapter . invokeVirtual ( Types . PAGE_CONTEXT , TagTry . GET_CATCH ) ; adapter . storeLocal ( old ) ; TryCatchFinallyVisitor tcfv = new TryCatchFinallyVisitor ( new OnFinally ( ) { @ Override public void _writeOut ( BytecodeContext bc ) throws TransformerException { adapter . loadArg ( 0 ) ; adapter . loadLocal ( old ) ; adapter . invokeVirtual ( Types . PAGE_CONTEXT , TagTry . SET_CATCH_PE ) ; _writeOutFinally ( bc , lRef ) ; } } , getFlowControlFinal ( ) ) ; tcfv . visitTryBegin ( bc ) ; tryBody . writeOut ( bc ) ; int lThrow = tcfv . visitTryEndCatchBeging ( bc ) ; _writeOutCatch ( bc , lRef , lThrow , old ) ; tcfv . visitCatchEnd ( bc ) ; }
@see lucee.transformer.bytecode.statement.StatementBase#_writeOut(org.objectweb.asm.commons.GeneratorAdapter)