Examples of TryData


Examples of sun.tools.asm.TryData

            f2 = new LocalMember(where, thisClass, 0, Type.tInt, null);
            num1 = new Integer(ctx.declare(env, f1));
            num2 = new Integer(ctx.declare(env, f2));
        }

        TryData td = new TryData();
        td.add(null);

        // Main body
        CodeContext bodyctx = new CodeContext(ctx, this);
        asm.add(where, opc_try, td); // start of protected code
        body.code(env, bodyctx, asm);
        asm.add(bodyctx.breakLabel);
        asm.add(td.getEndLabel());   // end of protected code

        // Cleanup afer body
        if (finallyCanFinish) {
            asm.add(where, opc_jsr, bodyctx.contLabel);
            asm.add(where, opc_goto, endLabel);
        } else {
            // just goto the cleanup code.  It will never return.
            asm.add(where, opc_goto, bodyctx.contLabel);
        }

        // Catch code
        CatchData cd = td.getCatch(0);
        asm.add(cd.getLabel());
        if (finallyCanFinish) {
            asm.add(where, opc_astore, num1); // store exception
            asm.add(where, opc_jsr, bodyctx.contLabel);
            asm.add(where, opc_aload, num1); // rethrow exception
View Full Code Here

Examples of sun.tools.asm.TryData

     * Code
     */
    public void code(Environment env, Context ctx, Assembler asm) {
        CodeContext newctx = new CodeContext(ctx, this);

        TryData td = new TryData();
        for (int i = 0 ; i < args.length ; i++) {
            Type t = ((CatchStatement)args[i]).field.getType();
            if (t.isType(TC_CLASS)) {
                td.add(env.getClassDeclaration(t));
            } else {
                td.add(t);
            }
        }
        asm.add(where, opc_try, td);
        if (body != null) {
            body.code(env, newctx, asm);
        }

        asm.add(td.getEndLabel());
        asm.add(where, opc_goto, newctx.breakLabel);

        for (int i = 0 ; i < args.length ; i++) {
            CatchData cd = td.getCatch(i);
            asm.add(cd.getLabel());
            args[i].code(env, newctx, asm);
            asm.add(where, opc_goto, newctx.breakLabel);
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.