Package org.allspice.bytecode

Examples of org.allspice.bytecode.LValue


        varDecl,
        new VarDecl("Throwable","$$ex$$"),
        new VarDecl("returnAddress","$$ra$$"))
        );
    EvaluationContext newContext = context.addFinallyDest(finallyMark).setVars(vars) ;
    LValue v = newContext.getVar("$$mon$$") ;
    Var ex = (Var)newContext.getVar("$$ex$$") ;
    Var vret = (Var)newContext.getVar("$$ra$$") ;
    makeInit(newContext,varDecl.init,v.getType(),l) ;
    l.add(new Dup(TypeCode.VOID,TypeCode.OBJECT)) ;
    l.add(new Store(v)) ;
    l.add(new MonitorEnter()) ;
    Mark the_end = new Mark() ;
    Mark start_pc = new Mark() ;
View Full Code Here


      createConversion(ilc, t.src, t.dst);
    }
  }
  private static final class LoadConverter implements InstConverter<Load> {
    public void convertInst(Load t, InstructionListContext ilc) {
      LValue lval = t.var;
      createLoad(ilc, lval);
    }
View Full Code Here

    }
  }
  private static final class IncrementConverter implements InstConverter<Increment> {
    public void convertInst(Increment t, InstructionListContext ilc) {
      Number c = t.count;
      LValue var = t.var;
      createIncrement(ilc,c, var);
    }
View Full Code Here

      createIncrement(ilc,c, var);
    }
  }
  private static final class StoreConverter implements InstConverter<Store> {
    public void convertInst(Store t, InstructionListContext ilc) {
      LValue lval = t.var;
      createStore(ilc, lval);
    }
View Full Code Here

        EvaluationContext context, InstList l) throws CompilerException {
      Expr inc = t.rhs;
      final Expr var = t.lhs;
      final StubResolver type = context.getType(var);
      if (type.getTypeName().equals(TypeName.STRING)) {
        LValue v = context.compileLValue(var, l);
        l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
        l.add(new Load(v)) ;
        convert(context,type, TypeName.OBJECT, l) ;
        l.add(new New(TypeName.STRINGBUILDER)) ;
        l.add(new Dup(TypeCode.VOID,TypeCode.OBJECT)) ;
        l.add(new InvokeSpecial(new MethodRef(TypeName.STRINGBUILDER,TypeName.VOID,"<init>"))) ;
View Full Code Here

    public LValue compileLValue(AddInPlaceExpr t,EvaluationContext context, InstList l) throws CompilerException {
      Expr inc = t.rhs;
      final Expr var = t.lhs;
      final StubResolver type = context.getType(var);
      if (type.getTypeName().equals(TypeName.STRING)) {
        LValue v = context.compileLValue(var, l);
        l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
        l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
        l.add(new Load(v)) ;
        convert(context,type, TypeName.OBJECT, l) ;
        l.add(new New(TypeName.STRINGBUILDER)) ;
        l.add(new Dup(TypeCode.VOID,TypeCode.OBJECT)) ;
        l.add(new InvokeSpecial(new MethodRef(TypeName.STRINGBUILDER,TypeName.VOID,"<init>"))) ;
View Full Code Here

    l.add(new Goto(beginmark)) ;
    l.add(new Nop(endmark)) ;
  }

  public static void createIncNoReturn(EvaluationContext context,Expr e,Number inc,InstList l) throws CompilerException {
    LValue v = context.compileLValue(e, l) ;
    l.add(new Increment(v,inc)) ;
  }
View Full Code Here

    LValue v = context.compileLValue(e, l) ;
    l.add(new Increment(v,inc)) ;
  }

  public static LValue createInc(EvaluationContext context,Expr e,Number inc,InstList l) throws CompilerException {
    LValue v = context.compileLValue(e, l) ;
    l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
    l.add(new Increment(v,inc)) ;
    return v ;
  }
View Full Code Here

    l.add(new Increment(v,inc)) ;
    return v ;
  }

  public static void createPostInc(EvaluationContext context,TypeName forwardType, Expr e,Number inc, InstList l) throws CompilerException {
    LValue v = context.compileLValue(e, l) ;
    if (TypeCode.getType(forwardType) == TypeCode.VOID) {
      l.add(new Increment(v,inc)) ;
    }
    else {
      l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
      l.add(new Load(v)) ;
      final TypeCode tc = TypeCode.getType(v.getType());
      l.add(new Dup(v.getRefType(),tc)) ;
      l.add(new Pop(tc)) ;
      l.add(new Increment(v,inc)) ;
      convert(context,context.getType(e),forwardType,l) ;
    }
  }
View Full Code Here

      convert(context,context.getType(e),forwardType,l) ;
    }
  }

  public static void createVarLValueNoReturn(EvaluationContext context, String var) throws CompilerException {
    final LValue v = context.getVar(var);
    if (v == null) {
      throw new UndefinedVariable(var) ;
    }
  }
View Full Code Here

TOP

Related Classes of org.allspice.bytecode.LValue

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.