Examples of MethodRef


Examples of org.allspice.bytecode.MethodRef

        l.add(new Dup(TypeCode.VOID,v.getRefType())) ;
        l.add(new Load(v)) ;
        convert(context,type, TypeName.OBJECT, l) ;
        l.add(new New(TypeName.STRINGBUILDER)) ;
        l.add(new Dup(TypeCode.VOID,TypeCode.OBJECT)) ;
        l.add(new InvokeSpecial(new MethodRef(TypeName.STRINGBUILDER,TypeName.VOID,"<init>"))) ;
        l.add(new Swap()) ;
        l.add(new InvokeVirtual(new MethodRef(TypeName.STRINGBUILDER,TypeName.STRINGBUILDER,"append",TypeName.OBJECT))) ;
        StdJavaExpressions.createConvert(context, inc, TypeName.OBJECT,l) ;
        l.add(new InvokeVirtual(new MethodRef(TypeName.STRINGBUILDER,TypeName.STRINGBUILDER,"append",TypeName.OBJECT))) ;
        l.add(new InvokeVirtual(new MethodRef(TypeName.STRINGBUILDER,TypeName.STRING,"toString"))) ;
        l.add(new Store(v)) ;
        return v ;
      }
      else {
        ConstObj o = context.getConst(inc) ;
View Full Code Here

Examples of org.allspice.bytecode.MethodRef

  }
  public ClassDef makeClass() {
    ClassDef cd = new ClassDef(ClassDefType.DEFAULT,null,new TypeName("TestClass"),TypeName.OBJECT) ;
    {
      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)
View Full Code Here

Examples of org.allspice.bytecode.MethodRef

public class TestThrow extends MyTestCase {
  public ClassDef defadd() {
    ClassDef cd = makeClassDef() ;
    {
      MethodRef mref = new MethodRef(
          new TypeName("java.lang.RuntimeException"),TypeName.VOID,"<init>") ;
      MethodDef md = new MethodDef(TypeName.VOID,"getFoo") ;
      md = md.setStatic(true) ;
      md = md.addInstructions(
          new New(new TypeName("java.lang.RuntimeException")),
View Full Code Here

Examples of org.allspice.bytecode.MethodRef

  public static MethodRef createMethodRef(MethodStub stub) {
    FIFO<TypeName> types = new FIFO<TypeName>() ;
    for(StubResolver r: stub.types) {
      types = types.insert(r.getTypeName()) ;
    }
    return new MethodRef(stub.cl.getTypeName(),stub.returnType.getTypeName(),stub.nm,types) ;
  }
View Full Code Here

Examples of org.allspice.bytecode.MethodRef

    l.add(new Dup(TypeCode.VOID,TypeCode.getType(type))) ;
    MethodStub fd = context.getMethod(context.makeTypeRef(fqtype), "<init>", args) ;
    if (fd == null) {
      throw new UndefinedMethod("<init>") ;
    }
    MethodRef mref = createMethodRef(fd) ;
    for(Expr e: args) {
      context.compile(null,e, l) ;
    }
    l.add(new InvokeSpecial(mref)) ;
  }
View Full Code Here

Examples of org.allspice.bytecode.MethodRef

    l.add(new New(baseType,size.size())) ;
  }

  public static void createCall(EvaluationContext context, Expr decl, final Collection<Expr> args,InstList l) throws CompilerException, UndefinedMethod {
    MethodInvocation fd = createMethDef(context,args,decl) ;
    MethodRef mref = createMethodRef(fd.stub) ;
    if (fd.stub.isStatic) {
      createStaticCall(context,args,mref.parameters,new InvokeStatic(mref),l) ;
    }
    else {
      if (fd.stub.isPrivate || fd.isSuper || mref.name.equals("<init>")) {
View Full Code Here

Examples of org.allspice.bytecode.MethodRef

      // constructor called <init>
      // must call superclass's <init>
      // Returns nothing
      MethodDef md = new MethodDef(TypeName.VOID,"<init>").addInstructions(
          new Load(new Var(0,new TypeName("TestClass"))),
          new InvokeSpecial(new MethodRef(cd.superClass,TypeName.VOID,"<init>")),
          new Return(TypeCode.VOID)
      ) ;
      // Watch it!  ClassDef is immutable
      cd = cd.addMethod(md) ;
    }
View Full Code Here

Examples of org.allspice.bytecode.MethodRef

      final Expr rhs = t.rhs;
      StubResolver type = getType(t,context) ;
      if (type.getTypeName().equals(TypeName.STRING)) {
        l.add(new New(TypeName.STRINGBUILDER)) ;
        l.add(new Dup(TypeCode.VOID,TypeCode.OBJECT)) ;
        l.add(new InvokeSpecial(new MethodRef(TypeName.STRINGBUILDER,TypeName.VOID,"<init>"))) ;
        context.compile(TypeName.OBJECT, lhs, l) ;
        l.add(new InvokeVirtual(new MethodRef(TypeName.STRINGBUILDER,TypeName.STRINGBUILDER,"append",TypeName.OBJECT))) ;
        context.compile(TypeName.OBJECT, rhs, l) ;
        l.add(new InvokeVirtual(new MethodRef(TypeName.STRINGBUILDER,TypeName.STRINGBUILDER,"append",TypeName.OBJECT))) ;
        l.add(new InvokeVirtual(new MethodRef(TypeName.STRINGBUILDER,TypeName.STRING,"toString"))) ;
      }
      else {
        super.compile(forwardType, t, context, l) ;
      }
    }
View Full Code Here

Examples of org.apache.yoko.rmi.util.stub.MethodRef

        MethodRef[] methods = new MethodRef[descriptors.length];

        for (int i = 0; i < mdesc.length; i++) {
            Method m = descriptors[i].getReflectedMethod();
            methods[i] = new MethodRef(m);
        }
        methods[mdesc.length] = new MethodRef(stub_write_replace);

        logger.finer("TYPE ----> " + type);
        logger.finer("LOADER --> " + UtilImpl.getClassLoader(type));
        logger.finer("CONTEXT -> " + getClassLoader());
View Full Code Here

Examples of org.apache.yoko.rmi.util.stub.MethodRef

        MethodRef[] methods = new MethodRef[descriptors.length];

        for (int i = 0; i < mdesc.length; i++) {
            Method m = descriptors[i].getReflectedMethod();
            methods[i] = new MethodRef(m);
        }
        methods[mdesc.length] = new MethodRef(stub_write_replace);

        logger.finer("TYPE ----> " + type);
        logger.finer("LOADER --> " + UtilImpl.getClassLoader(type));
        logger.finer("CONTEXT -> " + getClassLoader());
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.