Package org.allspice.bytecode.instructions

Examples of org.allspice.bytecode.instructions.Const


    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new IfLessThan(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
        new Nop(one),
        new Const(true),
        new Return(TypeCode.BOOLEAN)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here


    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfNotEquals0(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
        new Nop(one),
        new Const(true),
        new Return(TypeCode.BOOLEAN)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

      TypeName baseType = vtype.getArrayBase() ;
      createNewArray(context,Arrays.asList(new ConstExpr(Integer.valueOf(arrinit.size()),null)),vtype,l) ;
      int i = 0 ;
      for(Expr arrval: arrinit) {
        l.add(new Dup(TypeCode.VOID,TypeCode.getType(vtype))) ;
        l.add(new Const(Integer.valueOf(i))) ;
        context.compile(baseType, arrval, l) ;
        l.add(new Store(new ArrLValue(baseType))) ;
        i++ ;
      }
    }
View Full Code Here

        if (TypeCode.getType(forwardType) == TypeCode.VOID) {
          return ;
        }
        obj = cast(context.classPool,context.makeTypeRef(forwardType), new ConstObj(obj)) ;
      }
      result.add(new Const(obj)) ;
    }
View Full Code Here

    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new IfGreaterThan(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
        new Nop(one),
        new Const(true),
        new Return(TypeCode.BOOLEAN)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

    Mark three = new Mark() ;
    Mark others = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new LookupSwitch(new FIFO<CaseLabel>(new CaseLabel(3,three),new CaseLabel(1,one),new CaseLabel(2,two),new CaseLabel(null,others))),
        new Nop(one),new Const(1.0),new Return(TypeCode.DOUBLE),
        new Nop(two),new Const(2.0),new Return(TypeCode.DOUBLE),
        new Nop(three),new Const(3.0),new Return(TypeCode.DOUBLE),
        new Nop(others),new Const(0.0),new Return(TypeCode.DOUBLE)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new IfLessThanEq(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
        new Nop(one),
        new Const(true),
        new Return(TypeCode.BOOLEAN)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

        new Nop(end_pc),
        new Goto(the_end),
        new ExceptionHandler(start_pc,end_pc,handler,new TypeName("java.lang.Exception")),
        new Nop(handler),
        new Store(ex),
        new Const(1),
        new Return(TypeCode.INT),
        new Nop(the_end),
        new Const(2),
        new Return(TypeCode.INT)
        ) ;
    cd = cd.addMethod(md)
    return cd ;
  }
View Full Code Here

    Mark end = new Mark() ;
    context.compile(null,lhs, l) ;
    l.add(new IfEquals0(context.getTypeCode(lhs),isZero)) ;
    context.compile(null,rhs, l) ;
    l.add(new IfEquals0(context.getTypeCode(rhs),isZero)) ;
    l.add(new Const(Boolean.TRUE)) ;
    l.add(new Goto(end)) ;
    l.add(new Nop(isZero)) ;
    l.add(new Const(Boolean.FALSE)) ;
    l.add(new Nop(end)) ;
  }
View Full Code Here

    Mark end = new Mark() ;
    context.compile(null,lhs, l) ;
    l.add(new IfNotEquals0(context.getTypeCode(lhs),isOne)) ;
    context.compile(null,rhs, l) ;
    l.add(new IfNotEquals0(context.getTypeCode(rhs),isOne)) ;
    l.add(new Const(Boolean.FALSE)) ;
    l.add(new Goto(end)) ;
    l.add(new Nop(isOne)) ;
    l.add(new Const(Boolean.TRUE)) ;
    l.add(new Nop(end)) ;
  }
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.