Package org.allspice.bytecode.instructions

Examples of org.allspice.bytecode.instructions.Const


      final Expr lhs, final Expr rhs, TypeName t, Mark isTrue, Inst i, InstList l  ) throws CompilerException {
    createConvert(context,lhs,t,l) ;
    createConvert(context,rhs,t,l) ;
    Mark end = new Mark() ;
    l.add(i) ;
    l.add(new Const(Boolean.FALSE)) ;
    l.add(new Goto(end)) ;
    l.add(new Nop(isTrue)) ;
    l.add(new Const(Boolean.TRUE)) ;
    l.add(new Nop(end)) ;
  }
View Full Code Here


  public static void createNot(EvaluationContext context, Expr e, InstList l) throws CompilerException {
    context.compile(null,e, l) ;
    Mark isZero = new Mark() ;
    Mark end = new Mark() ;
    l.add(new IfEquals0(context.getTypeCode(e),isZero)) ;
    l.add(new Const(Boolean.FALSE)) ;
    l.add(new Goto(end)) ;
    l.add(new Nop(isZero)) ;
    l.add(new Const(Boolean.TRUE)) ;
    l.add(new Nop(end)) ;
  }
View Full Code Here

  public static void loadZero(TypeCode vtype,InstList l) {
    switch(vtype) {
    case ARRAY:
    case OBJECT:
      l.add(new Const(null)) ;
      break ;
    case BOOLEAN:
    case BYTE:
    case CHAR:
    case INT:
    case SHORT:
      l.add(new Const(Integer.valueOf(0))) ;
      break ;
    case DOUBLE:
      l.add(new Const(Double.valueOf(0))) ;
      break ;
    case FLOAT:
      l.add(new Const(Float.valueOf(0))) ;
      break ;
    case LONG:
      l.add(new Const(Long.valueOf(0))) ;
      break ;
    case VOID:
      break ;
    }
  }
View Full Code Here

TOP

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

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.