Package org.allspice.bytecode

Examples of org.allspice.bytecode.Var


    return cd ;
  }
  public ClassDef defadd02() {
    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


import org.allspice.bytecode.instructions.Return;

public class TestIFGT 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 TestInstanceOf extends MyTestCase {
  public ClassDef defadd(String type) {
    ClassDef cd = makeClassDef() ;
    {
      Var x = new Var(0,TypeName.OBJECT) ;
      MethodDef md = new MethodDef(TypeName.BOOLEAN,"getFoo",x) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new InstanceOf(new TypeName(type)),
View Full Code Here

import org.allspice.util.FIFO;

public class TestLookupSwitch extends MyTestCase {
  public ClassDef defadd() {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(1,TypeName.INT) ;
    MethodDef md = new MethodDef(TypeName.DOUBLE,"meth",x) ;
    Mark one = new Mark() ;
    Mark two = new Mark() ;
    Mark three = new Mark() ;
    Mark others = new Mark() ;
View Full Code Here

import org.allspice.bytecode.instructions.Return;

public class TestNegate extends MyTestCase {
  public ClassDef defadd(String ret,String type) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(1,new TypeName(type)) ;
    MethodDef md = new MethodDef(new TypeName(ret),"meth",x) ;
    md = md.addInstructions(
        new Load(x),
        new Negate(TypeCode.getType(type)),
        new Return(TypeCode.getType(ret))
View Full Code Here

    {
      MethodDef md = new MethodDef(TypeName.VOID,"<init>") ;
      MethodRef mref = new MethodRef(
          cd.superClass,TypeName.VOID,"<init>") ;
      md = md.addInstructions(
          new Load(new Var(0,new TypeName("TestClass"))),
          new InvokeSpecial(mref),
          new Return(TypeCode.VOID)
      ) ;
      cd = cd.addMethod(md) ;
    }
View Full Code Here

import org.allspice.bytecode.instructions.Return;

public class TestIFLE 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

import org.allspice.bytecode.instructions.UnsignedShiftRight;

public class TestUSHR extends MyTestCase {
  public ClassDef defadd(String ret,String type,int i1,int i2) {
    ClassDef cd = makeClassDef() ;
    Var x = new Var(i1,new TypeName(type)) ;
    Var y = new Var(i2,TypeName.INT) ;
    MethodDef md = new MethodDef(new TypeName(ret),"meth",x,y) ;
    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new UnsignedShiftRight(TypeCode.getType(type)),
View Full Code Here

    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+"[]")) ;
      Var y = new Var(1,TypeName.INT) ;
      Var z = new Var(2,new TypeName(type)) ;
      MethodDef md = new MethodDef(TypeName.VOID,"setFoo",x,y,z) ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Load(y),
View Full Code Here

import org.allspice.bytecode.instructions.Throw;

public class TestException extends MyTestCase {
  public ClassDef defadd() {
    ClassDef cd = makeClass() ;
    Var x = new Var(1,new TypeName("java.lang.Exception")) ;
    Var ex = new Var(2,new TypeName("java.lang.Exception")) ;
    MethodDef md = new MethodDef(TypeName.INT,"meth",x) ;
    Mark start_pc = new Mark() ;
    Mark end_pc = new Mark() ;
    Mark the_end = new Mark() ;
    Mark handler = new Mark() ;
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.