Package anvil.codec

Examples of anvil.codec.Code.invokevirtual()


    switch(operation) {
    case GET:
      _child.compile(context, GET);
      code.aload_first();
      code.astring(_attribute);
      code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY, "getAttribute",
        "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/core/Any;"));
      break;

    case GET_BOOLEAN:
      _child.compile(context, GET);
View Full Code Here


    case GET_BOOLEAN:
      _child.compile(context, GET);
      code.aload_first();
      code.astring(_attribute);
      code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY, "getAttribute",
        "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/core/Any;"));
      context.any2boolean();
      break;

    case CHECK:
View Full Code Here

    case CHECK:
      _child.compile(context, GET);
      code.aload_first();
      code.astring(_attribute);
      code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY, "checkAttribute",
        "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/core/Any;"));
      break;

    case DELETE:
      _child.compile(context, GET);
View Full Code Here

    case DELETE:
      _child.compile(context, GET);
      code.aload_first();
      code.astring(_attribute);
      code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY, "deleteAttribute",
        "(Lanvil/script/Context;Ljava/lang/String;)Z"));
      break;
    }
  }
View Full Code Here

  public void compile(ByteCompiler context, int operation)
  {
    Code code = context.getCode();
    code.aload_first();
    code.astring(_namespace.getName());
    code.invokevirtual(code.getPool().addMethodRef(context.TYPE_CONTEXT,
      "getNS", "(Ljava/lang/String;)Lanvil/core/Any;"));
    if (operation == GET_BOOLEAN) {
      context.any2boolean();
    }
  }
View Full Code Here

   
    if (methods != null) {
      int n = methods.length;
      if (n>3) {
        code.aload(l_attr);
        code.invokevirtual(pool.addMethodRef("java/lang/String", "hashCode", "()I"));
        Source notfound = code.getSource();
        Switch select = code.select();
        for(int i=0; i<n; i++) {
          select.addCase(methods[i].getName().substring(prefixLength).hashCode());
        }
View Full Code Here

    ConstantPool pool = code.getPool();
    int clazz = pool.addClass("anvil/core/runtime/AnyType");
    code.anew(clazz);
    code.dup();
    _child.compile(context, CHECK);
    code.invokevirtual(pool.addMethodRef(context.TYPE_ANY, "type",
      "()Lanvil/script/Type;"));
    code.invokespecial(pool.addMethodRef(clazz, "<init>",
      "(Lanvil/script/Type;)V"));
    if (operation == GET_BOOLEAN) {
      context.any2boolean();
View Full Code Here

    _child.compile(context, GET);
    Code code = context.getCode();
    ConstantPool pool = code.getPool();
    switch(_type) {
    case IS_DEFINED:
      code.invokevirtual(pool.addMethodRef(context.TYPE_ANY,
        "isDefined", "()Z"));
      break;

    case IS_UNDEFINED:
      code.invokevirtual(pool.addMethodRef(context.TYPE_ANY,
View Full Code Here

      code.invokevirtual(pool.addMethodRef(context.TYPE_ANY,
        "isDefined", "()Z"));
      break;

    case IS_UNDEFINED:
      code.invokevirtual(pool.addMethodRef(context.TYPE_ANY,
        "isUndefined", "()Z"));
      break;

    case Any.IS_NULL:
      code.invokevirtual(pool.addMethodRef(context.TYPE_ANY,
View Full Code Here

      code.invokevirtual(pool.addMethodRef(context.TYPE_ANY,
        "isUndefined", "()Z"));
      break;

    case Any.IS_NULL:
      code.invokevirtual(pool.addMethodRef(context.TYPE_ANY,
        "isNull", "()Z"));
      break;

    case Any.IS_BOOLEAN:
      code.invokevirtual(pool.addMethodRef(context.TYPE_ANY,
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.