Package org.allspice.bytecode.instructions

Examples of org.allspice.bytecode.instructions.Return


      MethodDef md = new MethodDef(TypeName.VOID,"setFoo",x) ;
      md = md.addInstructions(
          new Load(new Var(0,new TypeName("TestClass"))),
          new Load(x),
          new Store(new FieldRef(cd.name,new TypeName(type),"foo")),
          new Return(TypeCode.VOID)
          ) ;
      cd = cd.addMethod(md) ;
    }
    {
      MethodDef md = new MethodDef(new TypeName(type),"getFoo") ;
      md = md.addInstructions(
          new Load(new Var(0,new TypeName("TestClass"))),
          new Load(new FieldRef(cd.name,new TypeName(type),"foo")),
          new Return(TypeCode.getType(type))
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
View Full Code Here


    MethodDef md = new MethodDef(TypeName.INT,"meth",x,y) ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new Compare(TypeCode.getType(type)),
        new Return(TypeCode.INT)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

    MethodDef md = new MethodDef(TypeName.VOID,"meth",x) ;
    md = md.addInstructions(
        new Load(x),
        new Const(0),
        new Increment(new ArrLValue(TypeName.INT),inc),
        new Return(TypeCode.VOID)
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

    MethodDef md = new MethodDef(new TypeName(ret),"meth",x,y) ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new Divide(TypeCode.getType(type)),
        new Return(TypeCode.getType(ret))
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

      md = md.setStatic(true) ;
      md = md.addInstructions(
          new New(new TypeName("TestClass")),
          new org.allspice.bytecode.instructions.Dup(TypeCode.VOID,TypeCode.OBJECT),
          new InvokeSpecial(mref),
          new Return(TypeCode.OBJECT)
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
View Full Code Here

    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfGreaterThan0(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(new TypeName(ret),"meth",x,y) ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new Subtract(TypeCode.getType(type)),
        new Return(TypeCode.getType(ret))
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfEquals0(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 one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfLessThanEq0(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(ret,"meth",x,y) ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new Add(TypeCode.getType(type)),
        new Return(TypeCode.getType(ret))
        ) ;
    return cd.addMethod(md)
  }
View Full Code Here

TOP

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

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.