Package anvil.codec

Examples of anvil.codec.Code.invokevirtual()


    public void compile(ByteCompiler context, int operation)
    {
      Code code = context.getCode();
      ConstantPool pool = code.getPool();
      code.aload_first();
      code.invokevirtual(pool.addMethodRef(context.TYPE_CONTEXT, "frame",
        "()Lanvil/script/StackFrame;"));
      code.invokevirtual(pool.addMethodRef("anvil/script/StackFrame", "peek",
        "()Lanvil/core/Any;"));
    }
View Full Code Here


      Code code = context.getCode();
      ConstantPool pool = code.getPool();
      code.aload_first();
      code.invokevirtual(pool.addMethodRef(context.TYPE_CONTEXT, "frame",
        "()Lanvil/script/StackFrame;"));
      code.invokevirtual(pool.addMethodRef("anvil/script/StackFrame", "peek",
        "()Lanvil/core/Any;"));
    }

  }
View Full Code Here

            key.toCode(code);
            code.anew(intclazz);
            code.dup();
            code.iconst(c++);
            code.invokespecial(intclazzctor);
            code.invokevirtual(hashlistadd);
          }
        }
        code.aastore();
      }
      code.putstatic(_f_switch);
View Full Code Here

        break;

      case CompilableFunction.PARAMETER_OBJECT:
        if (c<max) {
          parameters[c++].compile(this, Node.GET);
          code.invokevirtual(pool.addMethodRef(TYPE_ANY,
            "toObject", "()Ljava/lang/Object;"));
        } else {
          if (defaultValue != null) {
            constant(defaultValue, true);
            code.invokevirtual(pool.addMethodRef(TYPE_ANY,
View Full Code Here

          code.invokevirtual(pool.addMethodRef(TYPE_ANY,
            "toObject", "()Ljava/lang/Object;"));
        } else {
          if (defaultValue != null) {
            constant(defaultValue, true);
            code.invokevirtual(pool.addMethodRef(TYPE_ANY,
              "toObject", "()Ljava/lang/Object;"));
          } else {
            code.aconst_null();
          }
        }
View Full Code Here

          Node node = parameters[c++];
          if (node.isConstant()) {
            code.iconst(node.eval().toInt());
          } else {
            node.compile(this, Node.GET);
            code.invokevirtual(pool.addMethodRef(TYPE_ANY,
              "toInt", "()I"));           
          }
        } else {
          if (defaultValue != null) {
            code.iconst(defaultValue.toInt());
View Full Code Here

          Node node = parameters[c++];
          if (node.isConstant()) {
            code.lconst(node.eval().toLong());
          } else {
            node.compile(this, Node.GET);
            code.invokevirtual(pool.addMethodRef(TYPE_ANY,
              "toLong", "()J"))
          }
        } else {
          if (defaultValue != null) {
            code.lconst(defaultValue.toLong());
View Full Code Here

          Node node = parameters[c++];
          if (node.isConstant()) {
            code.dconst(node.eval().toDouble());
          } else {
            node.compile(this, Node.GET);
            code.invokevirtual(pool.addMethodRef(TYPE_ANY,
              "toDouble", "()D"));
          }
        } else {
          if (defaultValue != null) {
            code.dconst(defaultValue.toDouble());
View Full Code Here

          Node node = parameters[c++];
          if (node.isConstant()) {
            code.astring(node.eval().toString());
          } else {
            node.compile(this, Node.GET);
            code.invokevirtual(pool.addMethodRef(TYPE_OBJECT,
              "toString", "()Ljava/lang/String;"));
          }
        } else {
          if (defaultValue != null) {
            code.astring(defaultValue.toString());
View Full Code Here

          code.dup();
          code.invokespecial(pool.addMethodRef(arrayclazz, "<init>", "()V"));
          for(; c < max; c++) {
            code.dup();
            parameters[c].compile(this, Node.GET);
            code.invokevirtual(appendmethod);
          }
        }
        break;

      case CompilableFunction.PARAMETER_ANYLIST:
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.