Package org.allspice.bytecode

Examples of org.allspice.bytecode.ClassDef.addMethod()


        new Load(y),
        new Add(TypeCode.INT),
        new Store(z),
        new ReturnVar(vret.index)
        ) ;
    cd = cd.addMethod(md)
    return cd ;
  }
  public void test1() throws Exception {
   
    ClassDef cd = defadd() ;
View Full Code Here


      md = md.addInstructions(
          new Load(x),
          new Store(new StaticFieldRef(cd.name,new TypeName(type),"foo")),
          new Return(TypeCode.VOID)
          ) ;
      cd = cd.addMethod(md) ;
    }
    {
      MethodDef md = new MethodDef(new TypeName(type),"getFoo") ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
View Full Code Here

      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(new StaticFieldRef(cd.name,new TypeName(type),"foo")),
          new Return(TypeCode.getType(type))
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
  public void test1() throws Exception {
   
View Full Code Here

        new Load(x),
        new Load(y),
        new Divide(TypeCode.getType(type)),
        new Return(TypeCode.getType(ret))
        ) ;
    return cd.addMethod(md)
  }
  public void test1() throws Exception {
   
    ClassDef cd = defadd("double","double",1,3) ;
    Object obj = makeObject(cd) ;
View Full Code Here

        new Return(TypeCode.BOOLEAN),
        new Nop(one),
        new Const(true),
        new Return(TypeCode.BOOLEAN)
        ) ;
    return cd.addMethod(md)
  }
  public void test1() throws Exception {
   
    ClassDef cd = defadd("double",1) ;
    Object obj = makeObject(cd) ;
View Full Code Here

        new Return(TypeCode.BOOLEAN),
        new Nop(one),
        new Const(true),
        new Return(TypeCode.BOOLEAN)
        ) ;
    return cd.addMethod(md)
  }
  public void test1() throws Exception {
   
    ClassDef cd = defadd("double",1,3) ;
    Object obj = makeObject(cd) ;
View Full Code Here

          new Load(y),
          new Swap(),
          new Subtract(TypeCode.INT),
          new Return(TypeCode.INT)
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
  public void test1() throws Exception {
    Class<?> obj = makeClass(defadd01()) ;
View Full Code Here

      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 ;
  }
  public void test1() throws Exception {
    Class<?> obj = makeClass(defadd("java.lang.String")) ;
View Full Code Here

          new Load(x),
          new Dup(TypeCode.VOID,TypeCode.INT),
          new Add(TypeCode.INT),
          new Return(TypeCode.INT)
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
  public ClassDef defadd02() {
    ClassDef cd = makeClassDef() ;
View Full Code Here

          new Load(x),
          new Dup(TypeCode.VOID,TypeCode.LONG),
          new Add(TypeCode.LONG),
          new Return(TypeCode.LONG)
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
  public ClassDef defadd11() {
    ClassDef cd = makeClassDef() ;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.