Package anvil.codec

Examples of anvil.codec.ConstantPool.addMethodRef()


    ConstantPool pool = clazz.getPool();
    Field members = clazz.createField("_members", "[Ljava/lang/Object;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    Code code = clazz.getStatic().getCode();
    context.pushCode(code);
    int intclazz = pool.addClass("java/lang/Integer");
    int intclazzctor = pool.addMethodRef(intclazz, "<init>", "(I)V");
    code.iconst(size * 4);
    code.anewarray("java/lang/Object");
    for(int i=0; types.hasMoreElements();) {
      Type type = (Type)types.nextElement();
      switch(type.getType()) {
View Full Code Here


    code.getstatic(field);
    code.aload(_context.getFrameIndex());
    int depth = Grammar.countEscapeDepth(_context, _function);
    if (depth >= 0) {
      code.iconst(depth+1);
      code.invokevirtual(pool.addMethodRef("anvil/script/StackFrame", "getEscape",
        "(I)Lanvil/script/StackFrame;"));
    }
    code.invokespecial(pool.addMethodRef(anyfunction, "<init>", signature));
    if (operation == GET_BOOLEAN) {
      context.any2boolean();
View Full Code Here

    if (depth >= 0) {
      code.iconst(depth+1);
      code.invokevirtual(pool.addMethodRef("anvil/script/StackFrame", "getEscape",
        "(I)Lanvil/script/StackFrame;"));
    }
    code.invokespecial(pool.addMethodRef(anyfunction, "<init>", signature));
    if (operation == GET_BOOLEAN) {
      context.any2boolean();
    }
  }
View Full Code Here

            "__module__", "Lanvil/script/compiler/NativeNamespace;"));
          code.aload_first();
          code.astring(_type.getName())
          int method;
          if (get_type) {
            method = pool.addMethodRef("anvil/script/compiler/NativeNamespace",
              "getDeclaration", "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/script/Type;");
          } else {
            method = pool.addMethodRef("anvil/script/compiler/NativeNamespace", "getFunction",
              "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/core/Any;");
          }
View Full Code Here

          int method;
          if (get_type) {
            method = pool.addMethodRef("anvil/script/compiler/NativeNamespace",
              "getDeclaration", "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/script/Type;");
          } else {
            method = pool.addMethodRef("anvil/script/compiler/NativeNamespace", "getFunction",
              "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/core/Any;");
          }
          code.invokevirtual(method);
        }
        break;
View Full Code Here

      case Type.CLASS:
        {
          code.getstatic(pool.addFieldRef(_type.getTypeRef(pool),
            "__class__", "Lanvil/script/compiler/NativeClass;"));
          if (!get_type) {
            code.invokevirtual(pool.addMethodRef("anvil/script/compiler/NativeClass",
              "getWrapper", "()Lanvil/core/Any;"));
          }
        }
        break;
       
View Full Code Here

      case Type.NAMESPACE:
        {
          code.getstatic(pool.addFieldRef(_type.getTypeRef(pool),
            "__module__", "Lanvil/script/compiler/NativeNamespace;"));
          if (!get_type) {
            code.invokevirtual(pool.addMethodRef("anvil/script/compiler/NativeNamespace",
              "getWrapper", "()Lanvil/core/Any;"));         
          }
        }
        break;
       
View Full Code Here

            "__class__", "Lanvil/script/compiler/NativeClass;"));
          int method;
          code.aload_first();
          code.astring(_type.getName())
          if (get_type) {
            method = pool.addMethodRef("anvil/script/compiler/NativeClass",
              "getDeclaration", "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/script/Type;");
          } else {
            method = pool.addMethodRef("anvil/script/compiler/NativeClass", "getMethod",
              "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/core/Any;");
          }
View Full Code Here

          code.astring(_type.getName())
          if (get_type) {
            method = pool.addMethodRef("anvil/script/compiler/NativeClass",
              "getDeclaration", "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/script/Type;");
          } else {
            method = pool.addMethodRef("anvil/script/compiler/NativeClass", "getMethod",
              "(Lanvil/script/Context;Ljava/lang/String;)Lanvil/core/Any;");
          }
          code.invokevirtual(method);
        }
        break;
View Full Code Here

          int field = pool.addFieldRef(parent.getTypeRef(pool), "_class",
            "Lanvil/script/compiler/CompiledClassType;");
          code.getstatic(field);
          code.aload_first();
          code.astring(_type.getName());
          code.invokevirtual(pool.addMethodRef(
            "anvil/script/compiler/CompiledClassType",
            get_type ?
              "getMember" :
              "getMemberType",
            get_type ?
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.