Package org.allspice.bytecode

Examples of org.allspice.bytecode.Var


    ClassDef cd = makeClassDef() ;
    FieldDef fd = new FieldDef(Scope.PUBLIC,new TypeName(type),"foo") ;
    fd = fd.setStatic(true) ;
    cd = cd.addField(fd) ;
    {
      Var x = new Var(0,new TypeName(type)) ;
      MethodDef md = new MethodDef(TypeName.VOID,"setFoo",x) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Store(new StaticFieldRef(cd.name,new TypeName(type),"foo")),
View Full Code Here


import org.allspice.bytecode.instructions.Return;

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),
View Full Code Here

import org.allspice.bytecode.instructions.Return;

public class TestIFNE extends MyTestCase {
  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),
View Full Code Here

public class TestSwap extends MyTestCase {
  public ClassDef defadd01() {
    ClassDef cd = makeClassDef() ;
    {
      Var x = new Var(0,TypeName.INT) ;
      Var y = new Var(1,TypeName.INT) ;
      MethodDef md = new MethodDef(TypeName.INT,"getFoo",x,y) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Load(y),
View Full Code Here

public class TestChkCast extends MyTestCase {
  public ClassDef defadd(String type) {
    ClassDef cd = makeClassDef() ;
    {
      Var x = new Var(0,TypeName.OBJECT) ;
      MethodDef md = new MethodDef(new TypeName(type),"getFoo",x) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Convert(TypeCode.getType(x.getType()),new TypeName(type)),
          new Return(TypeCode.getType(type))
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
View Full Code Here

public class TestDup extends MyTestCase {
  public ClassDef defadd01() {
    ClassDef cd = makeClassDef() ;
    {
      Var x = new Var(0,TypeName.INT) ;
      MethodDef md = new MethodDef(TypeName.INT,"getFoo",x) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Dup(TypeCode.VOID,TypeCode.INT),
View Full Code Here

    return cd ;
  }
  public ClassDef defadd02() {
    ClassDef cd = makeClassDef() ;
    {
      Var x = new Var(0,TypeName.LONG) ;
      MethodDef md = new MethodDef(TypeName.LONG,"getFoo",x) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Dup(TypeCode.VOID,TypeCode.LONG),
View Full Code Here

    return cd ;
  }
  public ClassDef defadd11() {
    ClassDef cd = makeClassDef() ;
    {
      Var x = new Var(0,TypeName.INT) ;
      Var y = new Var(1,TypeName.INT) ;
      MethodDef md = new MethodDef(TypeName.INT,"getFoo",x,y) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Load(y),
View Full Code Here

    return cd ;
  }
  public ClassDef defadd22() {
    ClassDef cd = makeClassDef() ;
    {
      Var x = new Var(0,TypeName.LONG) ;
      Var y = new Var(2,TypeName.LONG) ;
      MethodDef md = new MethodDef(TypeName.LONG,"getFoo",x,y) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Load(y),
View Full Code Here

    return cd ;
  }
  public ClassDef defadd21() {
    ClassDef cd = makeClassDef() ;
    {
      Var x = new Var(0,TypeName.LONG) ;
      Var y = new Var(2,TypeName.INT) ;
      MethodDef md = new MethodDef(TypeName.INT,"getFoo",x,y) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Load(y),
View Full Code Here

TOP

Related Classes of org.allspice.bytecode.Var

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.