Examples of iconst()


Examples of anvil.codec.Code.iconst()

  public void compile(ByteCompiler context, int operation)
  {
    Code code = context.getCode();
    if (operation == GET_BOOLEAN) {
      code.iconst(_const.toBoolean());
    } else {
      context.constant(_const, true);
    }
  }
View Full Code Here

Examples of anvil.codec.Code.iconst()

    ConstantPool pool = code.getPool();
    int clazz = pool.addClass("anvil/core/AnyList");
    int n = childs();
    code.anew(clazz);
    code.dup();
    code.iconst(n);
    code.anewarray(context.TYPE_ANY);
    for(int i=0; i<n; i++) {
      code.dup();
      code.iconst(i);
      getChild(i).compile(context, GET);
View Full Code Here

Examples of anvil.codec.Code.iconst()

    code.dup();
    code.iconst(n);
    code.anewarray(context.TYPE_ANY);
    for(int i=0; i<n; i++) {
      code.dup();
      code.iconst(i);
      getChild(i).compile(context, GET);
      code.aastore();
    }
    code.invokespecial(pool.addMethodRef(clazz, "<init>",
      "([Lanvil/core/Any;)V"));
View Full Code Here

Examples of anvil.codec.Code.iconst()

  {
    if (_escaped) {
      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

Examples of anvil.codec.Code.iconst()

      if (params[i].value != null) {
        count++;
      }
    }
    Code code = clazz.getStatic().getCode();
    code.iconst(count);
    code.anewarray("java/lang/Object");
    int j = 0;
    for(int i=0; i<size; i++) {
      Parameter param = params[i];
      Any defaultvalue = param.value;
View Full Code Here

Examples of anvil.codec.Code.iconst()

    int j = 0;
    for(int i=0; i<size; i++) {
      Parameter param = params[i];
      Any defaultvalue = param.value;
      code.dup();
      code.iconst(j++);
      if (param.type == CompilableFunction.PARAMETER_REST) {
        code.astring(".."+param.name);
      } else if (defaultvalue != null) {
        code.astring("*"+param.name);
      } else {
View Full Code Here

Examples of anvil.codec.Code.iconst()

        code.astring(param.name);
      }
      code.aastore();
      if (defaultvalue != null) { 
        code.dup();
        code.iconst(j++);
        context.constant(defaultvalue, false);
        code.aastore();
      }
    }
  } 
View Full Code Here

Examples of anvil.codec.Code.iconst()

    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();
      isfalse.bind();
      code.iconst(false);
      toend.bind();
    } else {
View Full Code Here

Examples of anvil.codec.Code.iconst()

    if (operation == GET_BOOLEAN) {
      Source isfalse = code.if_eq();
      code.iconst(true);
      Source toend = code.go_to();
      isfalse.bind();
      code.iconst(false);
      toend.bind();
    } else {
      code.invokestatic(code.getPool().addMethodRef(context.TYPE_ANY,
        "create", "(I)Lanvil/core/Any;"));
    }
View Full Code Here

Examples of anvil.codec.Code.iconst()

    case GET_BOOLEAN:
      _child.compile(context, GET_BOOLEAN);
      break;
 
    case DELETE:
      code.iconst(false);
      break;
    }
  }

}
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.