Package org.allspice.bytecode.instructions

Examples of org.allspice.bytecode.instructions.Convert


      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


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

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

    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 Convert(TypeCode.getType(type),new TypeName(ret)),
        new Return(TypeCode.getType(ret))
        ) ;
    cd = cd.addMethod(md) ;
    return cd ;
  }
View Full Code Here

  public static void convert(EvaluationContext context,StubResolver srctype,TypeName dsttype, InstList l) throws CompilerException {
    if (dsttype != null) {
      if (context.classPool.isSubClass(dsttype, srctype)) {
        return ;
      }
      l.add(new Convert(TypeCode.getType(srctype.getTypeName()),dsttype)) ;
    }
  }
View Full Code Here

TOP

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

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.