Package org.allspice.bytecode

Examples of org.allspice.bytecode.Mark


public class TestIFGT0 extends MyTestCase {
  public ClassDef defadd(String type,int i1) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfGreaterThan0(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
View Full Code Here


public class TestIFEQ0 extends MyTestCase {
  public ClassDef defadd(String type,int i1) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfEquals0(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
View Full Code Here

public class TestIFLE0 extends MyTestCase {
  public ClassDef defadd(String type,int i1) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfLessThanEq0(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
View Full Code Here

    Var x = new Var(1,TypeName.INT) ;
    Var y = new Var(2,TypeName.INT) ;
    Var z = new Var(3,TypeName.INT) ;
    Var vret = new Var(4,new TypeName("returnAddress")) ;
    MethodDef md = new MethodDef(TypeName.INT,"meth",x,y) ;
    Mark sub = new Mark() ;
    md = md.addInstructions(
        new JumpSub(sub),
        new Load(z),
        new Return(TypeCode.INT),
        new Nop(sub),
View Full Code Here

public class TestIFGE0 extends MyTestCase {
  public ClassDef defadd(String type,int i1) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfGreaterThanEq0(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
View Full Code Here

  public ClassDef defadd(String type,int i1,int i2) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    Var y = new Var(i2,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x,y) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new IfNotEqual(TypeCode.getType(type),one),
        new Const(false),
View Full Code Here

  public ClassDef defadd(String type,int i1,int i2) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    Var y = new Var(i2,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x,y) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new IfEquals(TypeCode.getType(type),one),
        new Const(false),
View Full Code Here

  public ClassDef defadd(String type,int i1,int i2) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    Var y = new Var(i2,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x,y) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new IfGreaterThanEq(TypeCode.getType(type),one),
        new Const(false),
View Full Code Here

public class TestIFLT0 extends MyTestCase {
  public ClassDef defadd(String type,int i1) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x) ;
    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfLessThan0(TypeCode.getType(type),one),
        new Const(false),
        new Return(TypeCode.BOOLEAN),
View Full Code Here

   * Creates instruction for comparing two int's
   * Adds the instruction(s) to the instruction list.
   * @param ilc The instruction list
   */
  private static void createCompareInt(InstructionListContext ilc) {
    Mark one = new Mark() ;
    Mark zero = new Mark() ;
    Mark end = new Mark() ;
    ilc.add(InstructionConstants.DUP2) ;
    ilc.addBranch(new IF_ICMPGT(null),one) ;
    ilc.addBranch(new IF_ICMPEQ(null),zero) ;
    ilc.add(ilc.getInstructionFactory().createConstant(Integer.valueOf(-1))) ;
    ilc.addBranch(new GOTO_W(null),end) ;
View Full Code Here

TOP

Related Classes of org.allspice.bytecode.Mark

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.