Package org.allspice.bytecode.instructions

Examples of org.allspice.bytecode.instructions.Dup


      final Expr lhs = t.lhs;
      final Expr rhs = t.rhs;
      StubResolver type = getType(t,context) ;
      if (type.getTypeName().equals(TypeName.STRING)) {
        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>"))) ;
        context.compile(TypeName.OBJECT, lhs, l) ;
        l.add(new InvokeVirtual(new MethodRef(TypeName.STRINGBUILDER,TypeName.STRINGBUILDER,"append",TypeName.OBJECT))) ;
        context.compile(TypeName.OBJECT, rhs, l) ;
        l.add(new InvokeVirtual(new MethodRef(TypeName.STRINGBUILDER,TypeName.STRINGBUILDER,"append",TypeName.OBJECT))) ;
View Full Code Here


    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

    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

    }
  }
 
  public static LValue createSetValueExpr(EvaluationContext context,Expr lhs,Expr e,InstList l) throws CompilerException {
    LValue v = context.compileLValue(lhs, l);
    l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
    makeInit(context,e,v.getType(),l) ;
    l.add(new Store(v)) ;
    return v ;
  }
View Full Code Here

  }

  public static void createNew(EvaluationContext context, final String type, final Collection<Expr> args, InstList l) throws CompilerException {
    TypeName fqtype = context.fullyQualified(type) ;
    l.add(new New(fqtype)) ;
    l.add(new Dup(TypeCode.VOID,TypeCode.getType(type))) ;
    MethodStub fd = context.getMethod(context.makeTypeRef(fqtype), "<init>", args) ;
    if (fd == null) {
      throw new UndefinedMethod("<init>") ;
    }
    MethodRef mref = createMethodRef(fd) ;
View Full Code Here

    }
  }

  public static void createInPlaceNoReturn(EvaluationContext context, Expr inc, final Expr var, final Inst inst,InstList l ) throws CompilerException {
    LValue v = context.compileLValue(var, l);
    l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
    l.add(new Load(v)) ;
    createConvert(context, inc, v.getType(),l) ;
    l.add(inst) ;
    l.add(new Store(v)) ;
  }
View Full Code Here

    l.add(new Store(v)) ;
  }

  public static LValue createInPlace(EvaluationContext context, Expr inc, final Expr var, final Inst inst,InstList l ) throws CompilerException {
    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)) ;
    createConvert(context, inc, v.getType(),l) ;
    l.add(inst) ;
    l.add(new Store(v)) ;
    return v ;
View Full Code Here

TOP

Related Classes of org.allspice.bytecode.instructions.Dup

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.