Examples of dup()


Examples of anvil.codec.Code.dup()

      int splicemethod = pool.addMethodRef(clazz, "splice",
        "(Lanvil/core/Any;)Lanvil/script/ParameterList;");
      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) {
View Full Code Here

Examples of anvil.codec.Code.dup()

        "()[Lanvil/core/Any;"));
    } else {
      code.iconst(n);
      code.anewarray(TYPE_ANY);
      for(int i=0; i<n; i++) {
        code.dup();
        code.iconst(i);
        parameters[i].compile(this, Node.GET);
        code.aastore();
      }
    }
View Full Code Here

Examples of anvil.codec.Code.dup()

  {
    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;");
View Full Code Here

Examples of anvil.codec.Code.dup()

    ConstantPool pool = code.getPool();
    int clazz = pool.addClass("java/lang/StringBuffer");
    int appendmethod = pool.addMethodRef(clazz, "append",
      "(Ljava/lang/Object;)Ljava/lang/StringBuffer;");
    code.anew(clazz);
    code.dup();
    code.invokespecial(pool.addMethodRef(clazz, "<init>", "()V"));
    int n = childs();
    for(int i=0; i<n; i++) {
      getChild(i).compile(context, GET);
      code.invokevirtual(appendmethod);
View Full Code Here

Examples of anvil.codec.Code.dup()

  public void compile(ByteCompiler context, int operation)
  {
    _left.compile(context, CHECK);
    Code code = context.getCode();
    code.dup();
    code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY,
      "toBoolean", "()Z"));
    Source iftrue = code.if_ne();
    code.pop();
    _right.compile(context, GET);
View Full Code Here

Examples of anvil.codec.Code.dup()

  {
    Code code = context.getCode();
    ConstantPool pool = code.getPool();
    int clazz = pool.addClass("anvil/core/AnyMap");
    code.anew(clazz);
    code.dup();
    super.compile(context, GET);
    code.invokespecial(pool.addMethodRef(clazz, "<init>",
      "(Lanvil/core/Any;Lanvil/core/Any;)V"));
    if (operation == GET_BOOLEAN) {
      context.any2boolean();
View Full Code Here

Examples of anvil.codec.Code.dup()

  {
    Code code = context.getCode();
    ConstantPool pool = code.getPool();
    int clazz = pool.addClass("anvil/core/AnyRange");
    code.anew(clazz);
    code.dup();
    super.compile(context, GET);
    code.invokespecial(pool.addMethodRef(clazz, "<init>",
      "(Lanvil/core/Any;Lanvil/core/Any;)V"));
    if (operation == GET_BOOLEAN) {
      context.any2boolean();
View Full Code Here

Examples of anvil.codec.Code.dup()

      child.compile(context, GET);
      code.invokevirtual(code.getPool().addMethodRef("anvil/script/StackFrame",
        "setLocal", "(ILanvil/core/Any;)Lanvil/core/Any;"));
    } else {
      child.compile(context, GET);
      code.dup();
      code.astore(_local.getIndex());
    }
  }
 
View Full Code Here

Examples of anvil.codec.Code.dup()

        break;

      case GET_REF:
        int refclass = pool.addClass("anvil/core/AnyLocalRef");
        code.anew(refclass);
        code.dup();
        code.aload(_local.getFrameIndex());
        code.iconst(_local.getSlot());
        code.invokespecial(pool.addMethodRef(refclass, "<init>", "(Lanvil/script/StackFrame;I)V"));
        break;
View Full Code Here

Examples of anvil.codec.Code.dup()

    int n = _bases.length;
    code.iconst(n);
    code.anewarray("java/lang/String");
    for(int i=0; i<n; i++) {
      InterfaceType interfacetype = _bases[i].getInterfaceType();
      code.dup();
      code.iconst(i);
      code.astring(interfacetype.getDescriptor().replace('/', '.'));
      code.aastore();
    }
    code.putstatic(bases);
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.