Examples of invokespecial()


Examples of anvil.codec.Code.invokespecial()

      ClassType[] clazz_parents = _class.getEnclosingClasses();
      int n = clazz_parents.length;
      for(int i=0; i<n; i++) {
        context.accessInstance(_context, clazz_parents[i]);
      }
      code.invokespecial(_class.getConstructorReference(pool));
      if (has_splices) {
        context.compileArgumentList(getChilds(0));
        code.invokeinterface(pool.addInterfaceMethodRef("anvil/script/Function", "execute",
          "(Lanvil/script/Context;Lanvil/core/Any;[Lanvil/core/Any;)Lanvil/core/Any;"));
      } else {
View Full Code Here

Examples of anvil.codec.Code.invokespecial()

      code.dup();
      code.iconst(i);
      getChild(i).compile(context, GET);
      code.aastore();
    }
    code.invokespecial(pool.addMethodRef(clazz, "<init>",
      "([Lanvil/core/Any;)V"));
    if (operation == context.GET_BOOLEAN) {
      context.any2boolean();
    }   
  }
View Full Code Here

Examples of anvil.codec.Code.invokespecial()

    clazz.setAccessFlags(ACC_PUBLIC|ACC_FINAL);

    Method method = clazz.createMethod("<init>", "()V", ACC_PUBLIC);
    Code code = method.getCode();
    code.self();
    code.invokespecial(pool.addMethodRef(clazz.getSuperClassIndex(), "<init>", "()V"));
    code.vreturn();

    method = clazz.createMethod("execute",
      "(Lanvil/script/Context;Lanvil/core/AnyClass;Lanvil/script/Generator;)Lanvil/core/Any;",
      ACC_PUBLIC|ACC_FINAL);
View Full Code Here

Examples of anvil.codec.Code.invokespecial()

    }
    code.getstatic(pool.addFieldRef(_thunk.getParent().getTypeRef(pool), name, "Lanvil/script/Function;"));
    if (inclass) {
      code.self();
    }
    code.invokespecial(pool.addMethodRef(clazz, "<init>", signature));

    if (operation == GET_BOOLEAN) {
      context.any2boolean();
    }
  }
View Full Code Here

Examples of anvil.codec.Code.invokespecial()

      for(int i=0; i<n; i++) {
        code.dup();
        code.iconst(i);
        code.anew(hashlistclazz);
        code.dup();
        code.invokespecial(hashlistctor);
        int c = 0;
        Enumeration keys = (Enumeration)_switches.elementAt(i);
        while(keys.hasMoreElements()) {
          Any key = (Any)keys.nextElement();
          if (key != SwitchStatement.DEFAULT_MARKER) {
View Full Code Here

Examples of anvil.codec.Code.invokespecial()

          if (key != SwitchStatement.DEFAULT_MARKER) {
            key.toCode(code);
            code.anew(intclazz);
            code.dup();
            code.iconst(c++);
            code.invokespecial(intclazzctor);
            code.invokevirtual(hashlistadd);
          }
        }
        code.aastore();
      }
View Full Code Here

Examples of anvil.codec.Code.invokespecial()

          int arrayclazz = pool.addClass("anvil/core/Array");
          int appendmethod = pool.addMethodRef(arrayclazz, "append",
            "(Lanvil/core/Any;)Lanvil/core/Array;");
          code.anew(arrayclazz);
          code.dup();
          code.invokespecial(pool.addMethodRef(arrayclazz, "<init>", "()V"));
          for(; c < max; c++) {
            code.dup();
            parameters[c].compile(this, Node.GET);
            code.invokevirtual(appendmethod);
          }
View Full Code Here

Examples of anvil.codec.Code.invokespecial()

            code.dup();
            code.iconst(index++);
            parameters[c].compile(this, Node.GET);
            code.aastore();
          }
          code.invokespecial(pool.addMethodRef(tupleclazz, "<init>",
            "([Lanvil/core/Any;)V"));
        }
        break;

      case CompilableFunction.PARAMETER_LIST:
View Full Code Here

Examples of anvil.codec.Code.invokespecial()

      int addmethod = pool.addMethodRef(clazz, "add",
        "(Lanvil/core/Any;)Lanvil/script/ParameterList;");
      code.anew(clazz);
      code.dup();
      code.iconst(n);
      code.invokespecial(pool.addMethodRef(clazz, "<init>", "(I)V"));
      for(int i=0; i<n; i++) {
        parameters[i].compile(this, Node.GET);
        if (parameters[i].typeOf() == Node.EXPR_SPLICE) {
          code.invokevirtual(splicemethod);
        } else {
View Full Code Here

Examples of anvil.codec.Code.invokespecial()

    Code code = context.getCode();
    ConstantPool pool = code.getPool();
    int clazz = pool.addClass("anvil/core/Array");
    code.anew(clazz);
    code.dup();
    code.invokespecial(pool.addMethodRef(clazz, "<init>", "()V"));
    int append1 = pool.addMethodRef(clazz, "append",
          "(Lanvil/core/Any;)Lanvil/core/Array;");
    int append2 = pool.addMethodRef(clazz, "append",
          "(Lanvil/core/Any;Lanvil/core/Any;)Lanvil/core/Array;");
    int n = childs();
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.