Package cn.wensiqun.asmsupport.definition.variable

Examples of cn.wensiqun.asmsupport.definition.variable.LocalVariable


  @Override
    public final LocalVariable createVariable(final String name, final AClass aClass, boolean anonymous, final Parameterized para) {
    if(aClass.isArray()){
      throw new IllegalArgumentException(aClass + " is Array type exchange to createArrayVariable to create the array variable");
    }
        LocalVariable lv = createOnlyVariable(aClass, name, anonymous);
        if(para == null){
            assign(lv, aClass.getDefaultValue());
        }else{
            assign(lv, para);
        }
View Full Code Here


        return lv;
    }
 
    @Override
    public final LocalVariable createArrayVariableWithAllocateDimension(final String name, final ArrayClass aClass, boolean anonymous, Parameterized... allocateDim) {
        LocalVariable lv = createOnlyVariable(aClass, name, anonymous);
        if(allocateDim == null){
            assign(lv, aClass.getDefaultValue());
        }else{
            assign(lv, newArray(aClass, allocateDim));
        }
View Full Code Here

        return lv;
    }
   
    @Override
  public final LocalVariable createArrayVariable(final String name, final ArrayClass aClass, boolean anonymous, Parameterized value) {
        LocalVariable lv = createOnlyVariable(aClass, name, anonymous);
        if(value == null){
            assign(lv, aClass.getDefaultValue());
        }else{
            assign(lv, value);
        }
View Full Code Here

        return lv;
  }

  @Override
  public LocalVariable createArrayVariable(String name, ArrayClass aClass, boolean anonymous, Object parameterizedArray) {
        LocalVariable lv = createOnlyVariable(aClass, name, anonymous);
        if(parameterizedArray == null){
            assign(lv, aClass.getDefaultValue());
        }else{
            assign(lv, getExecuteBlock().newArrayWithValue(aClass, parameterizedArray));
        }
View Full Code Here

    }

    @Override
    public void executing() {
        if(assigner == null){
            LocalVariable lv = (LocalVariable) factor;
            //insnHelper.iinc(lv.getScopeLogicVar().getPosition()[0], 1);
            insnHelper.iinc(lv.getScopeLogicVar().getInitStartPos(), 1);
        } else {
            assigner.execute();
        }
    }
View Full Code Here

    }

    @Override
    public void executing() {
        if(assigner == null){
            LocalVariable lv = (LocalVariable) factor;
            //insnHelper.iinc(lv.getScopeLogicVar().getPosition()[0], -1);
            insnHelper.iinc(lv.getScopeLogicVar().getInitStartPos(), -1);
        } else {
            assigner.execute();
        }
    }
View Full Code Here

        argments = new LocalVariable[argNames.length];
        for (int i = 0; i < argNames.length; i++) {
            ScopeLogicVariable slv = new ScopeLogicVariable(argNames[i], scope, argClsses[i].getType(),
                    argClsses[i].getType());
            LocalVariableEntity lve = new LocalVariableEntity(argNames[i], 0, argClsses[i]);
            LocalVariable lv = new LocalVariable(lve);
            lv.setScopeLogicVar(slv);
            argments[i] = lv;
        }
        method.setArguments(argments);
    }
View Full Code Here

        boolean currentCheckUnrechableCode = getExecuteBlock().whetherCheckUnreachableCode();
        getExecuteBlock().setWhetherCheckUnreachableCode(false);
       
        new Marker(this.getExecuteBlock(), implicitCatchStartLbl);
       
        LocalVariable exception = getLocalAnonymousVariableModel(AClass.THROWABLE_ACLASS);
        implicitCatchThrowableStore = new Store(getExecuteBlock(), exception);
       
        finallyBlock.clonerGenerate(getExecuteBlock());
       
        //throwException(exception);
View Full Code Here

        LocalVariableCreator lvc = OperatorFactory.newOperator(LocalVariableCreator.class,
            new Class<?>[]{ProgramBlock.class, String.class, Type.class, Type.class},
            getExecuteBlock(), anonymous ? null : name, aClass.getType(), aClass.getType());
        ScopeLogicVariable slv = lvc.getScopeLogicVariable();
        slv.setCompileOrder(insnHelper.getMethod().nextInsNumber());
        LocalVariable lv = new LocalVariable(lve);
        lv.setScopeLogicVar(slv);
        return lv;
  }
View Full Code Here

    @Override
    public final void generateInsn() {
     
        Label exceptionLbl = new Label();
        LocalVariable lv = getLocalVariableModel("e", exception);
        new Store(getExecuteBlock(), lv);
       
        lv.getScopeLogicVar().setSpecifiedStartLabel(exceptionLbl);
        new Marker(getExecuteBlock(), exceptionLbl);
        catchBody(lv);
       
        new Marker(getExecuteBlock(), endCatchLbl1);
        new NOP(getExecuteBlock());
View Full Code Here

TOP

Related Classes of cn.wensiqun.asmsupport.definition.variable.LocalVariable

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.