Package anvil.codec

Examples of anvil.codec.ConstantPool.addFieldRef()


    ConstantPool pool = code.getPool();
    int anyfunctionclazz = pool.addClass("anvil/core/runtime/AnyFunction");
    code.anew(anyfunctionclazz);
    code.dup();
    _child.compile(context, operation);
    code.getstatic(pool.addFieldRef(_method.getParent().getTypeRef(pool),
      "m_"+_method.getName()"Lanvil/script/Function;"));
    code.invokespecial(pool.addMethodRef(anyfunctionclazz, "<init>", "(Lanvil/core/Any;Lanvil/script/Function;)V"));
    if (operation == GET_BOOLEAN) {
      context.any2boolean();
    }
View Full Code Here


      Code code = method.getCode();
      ConstantPool pool = code.getPool();
      int l_context = code.addLocal();
      int l_parameters = code.addLocal();
      context.pushCode(code);
      code.getstatic(pool.addFieldRef(clazz.getIndex(), "m_"+function.getName(), "Lanvil/script/Function;"));
      code.aload(l_context);
      code.self();
      code.aload(l_parameters);
      code.invokeinterface(pool.addInterfaceMethodRef("anvil/script/Function",
        "execute", "(Lanvil/script/Context;Lanvil/core/Any;[Lanvil/core/Any;)Lanvil/core/Any;"));
View Full Code Here

      code.aload(l_newparameters);
      code.iconst(0);
      code.iload(l_index);
      code.invokestatic(pool.addMethodRef("anvil/core/Register", "getAnyNameOf", "(I)Lanvil/core/Any;"));
      code.aastore();
      code.getstatic(pool.addFieldRef(clazz.getIndex(), "m_"+function.getName(), "Lanvil/script/Function;"));
      code.aload(l_context);
      code.self();
      code.aload(l_newparameters);
      code.invokeinterface(pool.addInterfaceMethodRef("anvil/script/Function",
        "execute", "(Lanvil/script/Context;Lanvil/core/Any;[Lanvil/core/Any;)Lanvil/core/Any;"));
View Full Code Here

      int l_context = code.addLocal();
      int l_index = code.addLocal();
      int l_base = code.addLocal();
      code.addLocals(3);

      code.getstatic(pool.addFieldRef(clazz.getIndex(), "m_"+function.getName(), "Lanvil/script/Function;"));

      code.aload(l_context);

      code.self();
View Full Code Here

    compileMembers(context, _types.size(), _types.elements());

    Code code = clazz.getStatic().getCode();
    context.pushCode(code);
    //code.println("INTERFACE-START:"+getDescriptor());
    code.getstatic(pool.addFieldRef(_parent.getDescriptor(), "_members", "[Ljava/lang/Object;"));
    code.pop();
    //code.println("INTERFACE-END:"+getDescriptor());
    code.vreturn();
    context.popCode();
View Full Code Here

    ConstantPool pool = code.getPool();
    Source notequal = code.if_icmpne();
    if (operation == GET_BOOLEAN) {
      code.iconst(false);
    } else {
      code.getstatic(pool.addFieldRef(context.TYPE_ANY, "FALSE", "Lanvil/core/Any;"));
    }
    Source toend = code.go_to();
    notequal.bind();
    if (operation == GET_BOOLEAN) {
      code.iconst(true);
View Full Code Here

    Source toend = code.go_to();
    notequal.bind();
    if (operation == GET_BOOLEAN) {
      code.iconst(true);
    } else {
      code.getstatic(pool.addFieldRef(context.TYPE_ANY, "TRUE", "Lanvil/core/Any;"));
    }
    toend.bind();
  }
 
View Full Code Here

  {
    boolean enabled = getModuleStatement().getAddress().getZone().getAssert();
    if (enabled) {
      Code code = context.getCode();
      ConstantPool pool = code.getPool();
      code.getstatic(pool.addFieldRef(context.TYPE_MODULE, "_module", "Lanvil/script/compiler/CompiledModule;"));
      code.invokevirtual(pool.addMethodRef(
        "anvil/script/compiler/CompiledModule", "getAssert", "()Z"));
      Source source = code.if_eq();
      _condition.compile(context, Expression.GET_BOOLEAN);
      code.if_ne(source);
View Full Code Here

        code.aastore();
      }
      code.invokespecial(pool.addMethodRef(clazz, "<init>",
        "([Lanvil/core/Any;)V"));
    } else {
      code.getstatic(pool.addFieldRef(context.TYPE_ANY, "EMPTY_TUPLE",
        "Lanvil/core/AnyTuple;"));
    }
    if (operation == context.GET_BOOLEAN) {
      context.any2boolean();
    }   
View Full Code Here

    Enumeration e = _types.elements();
    while(e.hasMoreElements()) {
      Type type = (Type)e.nextElement();
      int typeid = type.getType();
      if (typeid == CLASS || typeid == INTERFACE) {
        code.getstatic(pool.addFieldRef(type.getTypeRef(pool),
          "_members", "[Ljava/lang/Object;"));
        code.pop();
      }
    }
    context.popCode();
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.