Package org.apache.flex.abc.semantics

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


                {
                    Name capabilitiesSlotName = capabilitiesReference.getMName();
                    initMethod.addInstruction(ABCConstants.OP_findpropstrict, capabilitiesSlotName);
                    initMethod.addInstruction(ABCConstants.OP_getproperty, capabilitiesSlotName);
                    initMethod.addInstruction(ABCConstants.OP_getproperty, new Name("hasAccessibility"));
                    Label accessibilityEnd = new Label();
                    initMethod.addInstruction(ABCConstants.OP_iffalse, accessibilityEnd);
   
                    IResolvedQualifiersReference enableAccessibilityReference = ReferenceFactory.packageQualifiedReference(flexProject.getWorkspace(),
                            "enableAccessibility");           
                    Name enableAccessibilityName = enableAccessibilityReference.getMName();
                    Object[] enableAccessibilityCallPropOperands = new Object[] { enableAccessibilityName, 0 };
                    for (String accessibilityClassName : accessibleClassNames)
                    {
                        IResolvedQualifiersReference ref = ReferenceFactory.packageQualifiedReference(flexProject.getWorkspace(),
                                accessibilityClassName);
                        Name accName = ref.getMName();
                        initMethod.addInstruction(ABCConstants.OP_getlex, accName);
                        initMethod.addInstruction(ABCConstants.OP_callproperty, enableAccessibilityCallPropOperands);
                        initMethod.addInstruction(ABCConstants.OP_pop);
                    }
   
                    initMethod.labelNext(accessibilityEnd);
                }
               
                // register class aliases
                if (!remoteClassAliasMap.isEmpty())
                {
                    Name getClassByAliasName = getClassByAliasReference.getMName();
                    Name registerClassAliasName = registerClassAliasReference.getMName();
                    Object[] getClassByAliasCallPropOperands = new Object[] { getClassByAliasName, 1 };
                    Object [] registerClassAliasCallPropOperands = new Object[] { registerClassAliasName, 2 };
                    for (Map.Entry<ClassDefinition, String> classAliasEntry : remoteClassAliasMap.entrySet())
                    {
                        Label tryLabel = new Label();
                        initMethod.labelNext(tryLabel);
                        initMethod.addInstruction(ABCConstants.OP_finddef, getClassByAliasName);
                        initMethod.addInstruction(ABCConstants.OP_pushstring, classAliasEntry.getValue());
                        initMethod.addInstruction(ABCConstants.OP_callproperty, getClassByAliasCallPropOperands);
                        Name classMName = classAliasEntry.getKey().getMName(flexProject);
                        initMethod.addInstruction(ABCConstants.OP_getlex, classMName);
                        Label endTryLabel = new Label();
                        initMethod.addInstruction(ABCConstants.OP_ifeq, endTryLabel);
                        initMethod.addInstruction(ABCConstants.OP_finddef, registerClassAliasName);
                        initMethod.addInstruction(ABCConstants.OP_pushstring, classAliasEntry.getValue());
                        initMethod.addInstruction(ABCConstants.OP_getlex, classMName);
                        initMethod.addInstruction(ABCConstants.OP_callpropvoid, registerClassAliasCallPropOperands);
                        initMethod.labelNext(endTryLabel);
                        Label afterCatch = new Label();
                        initMethod.addInstruction(ABCConstants.OP_jump, afterCatch);
                        Label catchLabel = new Label();
                        initMethod.labelNext(catchLabel);
                        initMethod.addInstruction(ABCConstants.OP_pop);
                        initMethod.addInstruction(ABCConstants.OP_finddef, registerClassAliasName);
                        initMethod.addInstruction(ABCConstants.OP_pushstring, classAliasEntry.getValue());
                        initMethod.addInstruction(ABCConstants.OP_getlex, classMName);
View Full Code Here


       
        body.addInstruction(OP_getlocal0);
        body.addInstruction(OP_pushscope);
                   
        // if (_MXMLDescriptor)
        Label label0 = new Label();
        body.addInstruction(OP_getlocal0);
        body.addInstruction(OP_getproperty, NAME_MXML_DESCRIPTOR);
        body.addInstruction(OP_not);
        body.addInstruction(OP_iffalse, label0);
       
        // arr = super.MXMLDescriptor;
        body.addInstruction(OP_findpropstrict, NAME_MXML_DESCRIPTOR_GETTER);
        body.addInstruction(OP_getsuper, NAME_MXML_DESCRIPTOR_GETTER);
        body.addInstruction(OP_setlocal1);

        // data = [...]
        addInstanceData(body, context);
        body.addInstruction(OP_setlocal2);
       
        // if (arr)
        Label label1 = new Label();
        body.addInstruction(OP_getlocal1);
        body.addInstruction(OP_iffalse, label1);
       
        // _MXMLDescriptor = arr.concat(data);
        body.addInstruction(OP_getlocal0);
View Full Code Here

                context.addInstruction(OP_getlocal0);
                context.stopUsing(IL.PROPERTIES, 1);
                return;
            }
            Label end = null;

            if (conditionally)
            {
                end = new Label();
                context.pushTarget();
                context.addInstruction(OP_getproperty, NAME_UNDERBAR_DOCUMENT);
                context.addInstruction(OP_pushnull);
                context.addInstruction(OP_ifne, end);
            }
View Full Code Here

        methodInstructions.addInstruction(ABCConstants.OP_getlocal1);
        methodInstructions.addInstruction(ABCConstants.OP_setsuper, moduleFactoryName);
       
        // if (mfi)
        //     return;
        Label label1 = new Label();
        methodInstructions.addInstruction(OP_getlocal0);
        methodInstructions.addInstruction(OP_getproperty, NAME_MODULE_FACTORY_INITIALIZED);
        methodInstructions.addInstruction(OP_iffalse, label1);
       
        methodInstructions.addInstruction(OP_returnvoid);
        methodInstructions.labelNext(label1);

        // mfi = true;
        methodInstructions.addInstruction(OP_getlocal0);
        methodInstructions.addInstruction(OP_pushtrue);
        methodInstructions.addInstruction(OP_setproperty, NAME_MODULE_FACTORY_INITIALIZED);
       
        if (hasStyleSpecifiers || hasEffectSpecifiers)
        {
            FlexProject project = this.getProject();
            Name cssStyleDeclarationName = project.getCSSStyleDeclarationClassName();
           
            // Create an anonymous function from the style and effect-style specifiers
            // for the class definition tag. It will be set as the value of
            // styleDeclaration.defaultFactory.
            MethodInfo styleDeclarationDefaultFactory = createStyleDeclarationDefaultFactory(context);
           
            // if (this.styleDeclaration == null)
            //     this.styleDeclaration = new CSSStyleDeclaration(null, this.styleManager);
            Label label2 = new Label();
            methodInstructions.addInstruction(OP_getlocal0);
            methodInstructions.addInstruction(OP_getproperty, NAME_STYLE_DECLARATION);
            methodInstructions.addInstruction(OP_iftrue, label2);
   
            methodInstructions.addInstruction(OP_getlocal0);
View Full Code Here

    void startExceptionContext(ITryNode tryNode)
    {
        ExceptionHandlingContext finally_context = new ExceptionHandlingContext(this);

        finally_context.finallyReturns = new Vector<ExceptionHandlingContext.FinallyReturn>();
        finally_context.finallyBlock = new Label();
        finally_context.finallyDoRethrow = new Label();
        finally_context.finallyDoFallthrough = new Label("finallyDoFallthrough");
        finally_context.finallyReturnStorage = currentScope.allocateTemp();

        activeFlowContexts.add(finally_context);
       
        finally_context.startTryControlState();
View Full Code Here

   
    @Override
    Label getGotoLabel(String label)
    {
        assert !getLabelNodes(label).isEmpty() : "Don't try to get AET labels for labels not in this context!";
        Label result = aetLabelMap.get(label);
        if (result != null)
            return result;
        result = new Label(label);
        aetLabelMap.put(label, result);
        return result;
    }
View Full Code Here

     */
    private InstructionList addFinallyReturn(InstructionList retblock)
    {
        assert(this.finallyReturns != null): "Not a finally context.";

        Label retblock_label = new Label();
        retblock.labelFirst(retblock_label);
        finallyReturns.add(new FinallyReturn(retblock_label, retblock));

        InstructionList result = new InstructionList();
        CmcEmitter.pushNumericConstant(finallyReturns.size(), result);
View Full Code Here

     */
    @Override
    Label getBreakLabel()
    {
        if ( null == this.breakLabel )
            this.breakLabel = new Label("#break#" + Integer.toHexString(this.hashCode()));
        return this.breakLabel;
    }
View Full Code Here

        int base_loc = out.size() - code_start;

        out.write(OP_lookupswitch);

        //  The last label is the default case.
        Label default_case = (Label)switch_insn.getOperand(case_size);
        int default_offset = (block_offsets.get(f.getBlock(default_case)) - base_loc);
        out.writeS24(default_offset);

        out.writeU30(case_size - 1);
View Full Code Here

     * @return a synthetic Label that identifies this InstructionList.
     */
    public Label getLabel()
    {
        checkValidity();
        Label result = new Label();
        labelFirst(result);
        return result;
    }
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.