Package org.allspice.bytecode.instructions

Examples of org.allspice.bytecode.instructions.Return


    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),
        new Store(vret),
        new Load(x),
        new Load(y),
        new Add(TypeCode.INT),
View Full Code Here


      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")),
          new Return(TypeCode.VOID)
          ) ;
      cd = cd.addMethod(md) ;
    }
    {
      MethodDef md = new MethodDef(new TypeName(type),"getFoo") ;
      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 ;
  }
View Full Code Here

    Mark one = new Mark() ;
    md = md.addInstructions(
        new Load(x),
        new IfGreaterThanEq0(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

    md = md.addInstructions(
        new Load(x),
        new Load(y),
        new IfNotEqual(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

      md = md.addInstructions(
          new Load(x),
          new Load(y),
          new Swap(),
          new Subtract(TypeCode.INT),
          new Return(TypeCode.INT)
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
View Full Code Here

      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

      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Dup(TypeCode.VOID,TypeCode.INT),
          new Add(TypeCode.INT),
          new Return(TypeCode.INT)
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
View Full Code Here

      md = md.setStatic(true) ;
      md = md.addInstructions(
          new Load(x),
          new Dup(TypeCode.VOID,TypeCode.LONG),
          new Add(TypeCode.LONG),
          new Return(TypeCode.LONG)
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
View Full Code Here

          new Load(x),
          new Load(y),
          new Dup(TypeCode.INT,TypeCode.INT),
          new Add(TypeCode.INT),
          new Add(TypeCode.INT),
          new Return(TypeCode.INT)
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
View Full Code Here

          new Load(x),
          new Load(y),
          new Dup(TypeCode.LONG,TypeCode.LONG),
          new Add(TypeCode.LONG),
          new Add(TypeCode.LONG),
          new Return(TypeCode.LONG)
          ) ;
      cd = cd.addMethod(md) ;
    }
    return cd ;
  }
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.