Package org.apache.flex.abc.semantics

Examples of org.apache.flex.abc.semantics.Label


    {
        IDynamicAccessNode arrayIndexNode = (IDynamicAccessNode)((IBinaryOperatorNode)iNode).getLeftOperandNode();
       
        InstructionList result = createInstructionList(iNode, stem.size() * 2 + index.size() + expr.size() + 11 );

        Label tail = new Label();
        int failure_test = is_and? OP_iffalse : OP_iftrue;

        //  Although ASC evaluates the stem twice, it only evaluates the index once.
        //  TODO: Inspect the index expression for side effects so the temp can be
        //  elided in most cases.
View Full Code Here


    {
        InstructionList result = createInstructionList(iNode);
        int failure_test = is_and? OP_iffalse : OP_iftrue;
        currentScope.getMethodBodySemanticChecker().checkCompoundAssignment(iNode, member, failure_test);

        Label tail = new Label();

        result.addAll(replicate(stem));
        result.addAll(stem);
        result.addInstruction(OP_getproperty, member.getName());
        //  Assume this is the result.
View Full Code Here

        InstructionList finally_insns = new InstructionList();
        InstructionList final_throw = new InstructionList();

        ExceptionHandlingContext finally_context = currentScope.getFlowManager().getFinallyContext();

        Label final_catch_target = final_catch.getLabel();

        //  We need a local to store the caught exception.
        Binding exception_storage = finally_context.getExceptionStorage();

        Collection<Label> pending_normal_control_flow = try_stmt.stripPendingLabels();

        if ( try_stmt.canFallThrough() || pending_normal_control_flow != null )
        {
            normal_flow_fixup.addInstruction(OP_jump, finally_context.finallyBlock);
        }
        else
        {
            //  Extend the region past a terminating
            //  throw statement to give the AVM a
            //  little buffer to figure out its
            //  exception-handling regions.
            normal_flow_fixup.addInstruction(OP_nop);
        }

        Label try_start = try_stmt.getLabel();
        Label try_end   = normal_flow_fixup.getLastLabel();

        Label finally_region_end = null;

        if ( null == catch_blocks )
        {
            finally_region_end = try_end;
        }
View Full Code Here

        result.addInstruction(OP_jump, test_insns_with_debug_ops.getLabel());

        //  Loop body
        InstructionList loop_body = new InstructionList();
        Label loop_head = new Label();
        loop_body.addInstruction(OP_label);
        loop_body.labelCurrent(loop_head);
        loop_body.addAll(body);

        //  Set the continue target on the correct instruction.
View Full Code Here

        result.addInstruction(OP_pushstring, "");
        result.addInstruction(OP_construct, 1);
        result.addInstruction(result_temp.setlocal());

        //  Jump to the loop test.
        Label test = new Label();
        result.addInstruction(OP_jump, test);

        //  Top of the loop: put an AET Label on
        //  the ABC OP_Label.
        Label loop = new Label();
        result.labelNext(loop);
        result.addInstruction(OP_label);
        //  Get the next value and cache it.
        result.addInstruction(hasnext.stem_temp.getlocal());
        result.addInstruction(hasnext.index_temp.getlocal());
        result.addInstruction(OP_nextvalue);
        result.addInstruction(OP_dup);
        result.addInstruction(value_temp.setlocal() );
        //  See ECMA-357 11.2.4
        result.addInstruction(OP_pushwith);

        result.addAll(filter);

        Label no_match = new Label();
        result.addInstruction(OP_iffalse, no_match);

        result.addInstruction(result_temp.getlocal() );
        result.addInstruction(hasnext.index_temp.getlocal() );
        result.addInstruction(value_temp.getlocal() );
View Full Code Here

        InstructionList result = createInstructionList(iNode);

        boolean has_else = !if_elseif.isEmpty();

        //  Label to the "next statement."
        Label tail = null;

        //  TODO: Use conditionalJump style tests.
        result.addAll(test);

        if ( has_else )
View Full Code Here

     *    responsible for saving this label and applying it appropriately at
     *    the destination point.
     */
    private Label addBranch(InstructionList insns, Label previousLabel, int opcode)
    {
        Label result = previousLabel != null? previousLabel: new Label();
        insns.addInstruction(opcode, result);
        return result;
    }
View Full Code Here

     *    otherwise a new Label that the caller must use to label the next
     *    part of the statement.
     */
    private Label addInterstitialControlFlow(InstructionList insns, Label previousLabel)
    {
        Label result;

        if ( insns.canFallThrough() )
        {
            result = addBranch(insns, previousLabel, OP_jump);
        }
View Full Code Here

    }

    public InstructionList reduce_labeledStmt(IASNode iNode, String label, InstructionList substatement)
    {
        InstructionList result = createInstructionList(iNode, 1);
        Label gotoLabel = currentScope.getFlowManager().getGotoLabel(label);
        // Since duplicate labels are invisible to goto statements,
        // we can fail to find a goto context for a label.
        if (gotoLabel != null)
        {
            result.labelNext(gotoLabel);
View Full Code Here

    }

    public InstructionList reduce_logicalAndExpr(IASNode iNode, InstructionList l, InstructionList r)
    {
        InstructionList result = createInstructionList(iNode, l.size() + r.size() + 3);
        Label tail = new Label();

        result.addAll(l);
        result.addInstruction(OP_dup);
        result.addInstruction(OP_iffalse, tail);
        result.addInstruction(OP_pop);
View Full Code Here

TOP

Related Classes of org.apache.flex.abc.semantics.Label

Copyright © 2018 www.massapicom. 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.