Package anvil.codec

Examples of anvil.codec.Code.invokevirtual()


      if (hasSplices()) {
        code.getstatic(pool.addFieldRef(_class.getTypeRef(pool),
          "__class__", "Lanvil/script/compiler/NativeClass;"));
        code.aload_first();
        context.compileArgumentList(getChilds(0));
        code.invokevirtual(pool.addMethodRef(
          "anvil/script/compiler/NativeClass", "newInstance",
          "(Lanvil/script/Context;[Lanvil/core/Any;)Lanvil/core/Any;"));
         
       } else {
         context.compileCall(_constructor, getChilds(0));
View Full Code Here


        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 {
        context.compileArgumentList(_constructor, getChilds(0));
        code.invokevirtual(_constructor.getTypeRef(pool));
      }
    }
    if (operation == GET_BOOLEAN) {
      context.any2boolean();
    }
View Full Code Here

        child.compile(context, new Node() {
          public void compile(ByteCompiler context, int operation)
          {
            Code code_ = context.getCode();
            code_.aload(tmp);
            code_.invokevirtual(code_.getPool().addMethodRef(context.TYPE_ANY, "decrease", "()Lanvil/core/Any;"));
          }     
        });
        code.pop();
        code.aload(tmp);
        code.endLocal(tmp);
View Full Code Here

      FunctionStatement function = (FunctionStatement)_parent;
      Code code = context.getCode();
      code.aload(function.getFrameIndex());
      code.iconst(getSlot());
      code.aload(_index);
      code.invokevirtual(code.getPool().addMethodRef(context.TYPE_STACKFRAME,
        "setLocal", "(ILanvil/core/Any;)Lanvil/core/Any;"));
      code.pop();
    }
  }
View Full Code Here

  public void compile(ByteCompiler context, int operation)
  {
    _child.compile(context, GET);
    Code code = context.getCode();
    code.astring(_symbol);
    code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY,
      "has", "(Ljava/lang/String;)Z"));
    if (operation != GET_BOOLEAN) {
      context.boolean2any();
    }
  }
View Full Code Here

        _indexvar.compile(context, new Node() {
          public void compile(ByteCompiler context, int operation)
          {
            Code code_ = context.getCode();
            _indexvar.compile(context, GET);
            code_.invokevirtual(code_.getPool().addMethodRef(context.TYPE_ANY,
              "increase", "()Lanvil/core/Any;"));
          }
        });
        code.pop();
      }
View Full Code Here

        code.getstatic(pool.addFieldRef(_function.getParent().getTypeRef(pool),
          "__module__", "Lanvil/script/compiler/NativeNamespace;"));
        code.aload_first();
        code.astring(_function.getName())
        context.compileArgumentList(getChilds(0));
        code.invokevirtual(pool.addMethodRef(
          "anvil/script/compiler/NativeNamespace", "execute",
          "(Lanvil/script/Context;Ljava/lang/String;[Lanvil/core/Any;)Lanvil/core/Any;"));
         
      } else {
        context.compileCall(_function, getChilds(0));
View Full Code Here

    code.aload(1);
    code.aload(3);
    int method_ref = pool.addMethodRef(
        parent_ref, "h_"+function.getName(), "(Lanvil/script/Context;Lanvil/script/Generator;)Lanvil/core/Any;");
    if (ismethod) {
      code.invokevirtual(method_ref);
    } else {
      code.invokestatic(method_ref);
    }
    code.areturn();
View Full Code Here

  public void compile(ByteCompiler context, int operation)
  {
    super.compile(context, GET);
    Code code = context.getCode();
    code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY,
      "compareTo", "(Lanvil/core/Any;)I"));
    if (operation == GET_BOOLEAN) {
      Source isfalse = code.if_eq();
      code.iconst(true);
      Source toend = code.go_to();
View Full Code Here

  public void compile(ByteCompiler context, int operation)
  {
    _child.compile(context, CHECK);
    Code code = context.getCode();
    code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY,
      "classNameOf", "()Ljava/lang/String;"));
    code.invokestatic(code.getPool().addMethodRef(context.TYPE_ANY,
      "create", "(Ljava/lang/String;)Lanvil/core/Any;"));
    if (operation == GET_BOOLEAN) {
      context.any2boolean();
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.