Package anvil.codec

Examples of anvil.codec.Code.aload()


      if (_catches > 0) {
        handler.startCatch(code.getPool().addClass("anvil/script/ScriptException"));
        int l_throwable = code.addLocal();
        int l_data = code.addLocal();
        code.astore(l_throwable);
        code.aload(l_throwable);
        code.invokevirtual(code.getPool().addMethodRef("anvil/script/ScriptException", "getData", "()Lanvil/core/Any;"));
        code.astore(l_data);
        for(int i=0; i<_catches; i++) {
          _catch[i].compile(context, handler, l_data);
        }
View Full Code Here


        code.invokevirtual(code.getPool().addMethodRef("anvil/script/ScriptException", "getData", "()Lanvil/core/Any;"));
        code.astore(l_data);
        for(int i=0; i<_catches; i++) {
          _catch[i].compile(context, handler, l_data);
        }
        code.aload(l_throwable);
        code.athrow();
      }

      handler.endProtectedRegion();
View Full Code Here

      if (_finally != null) {
        handler.startCatch(0);
        int thrown = code.addLocal();
        code.astore(thrown);
        handler.callFinally();
        code.aload(thrown);
        code.athrow();
      }
      handler.endCatches();
      _handler = null;
View Full Code Here

        code.astore(tmp);
        child.compile(context, new Node() {
          public void compile(ByteCompiler context, int operation)
          {
            Code code = context.getCode();
            code.aload(tmp);
            code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY, "increase", "()Lanvil/core/Any;"));
          }     
        });
        code.pop();
        code.aload(tmp);
View Full Code Here

            code.aload(tmp);
            code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY, "increase", "()Lanvil/core/Any;"));
          }     
        });
        code.pop();
        code.aload(tmp);
        code.endLocal(tmp);
      }
      break;
     
    case Node.EXPR_ATTRIBUTE:
View Full Code Here

  public void compile(ByteCompiler context, Node child)
  {
    Code code = context.getCode();
    ConstantPool pool = code.getPool();
    code.aload(_context.getFrameIndex());
    code.iconst(_depth);
    code.iconst(_index);
    child.compile(context, GET);
    code.invokevirtual(code.getPool().addMethodRef(context.TYPE_STACKFRAME,
      "setLocal", "(IILanvil/core/Any;)Lanvil/core/Any;"));
View Full Code Here

    Code code = context.getCode();
    ConstantPool pool = code.getPool();
    switch(operation) {
    case GET:
    case CHECK:
      code.aload(_context.getFrameIndex());
      code.iconst(_depth);
      code.iconst(_index);
      code.invokevirtual(code.getPool().addMethodRef(context.TYPE_STACKFRAME,
        "getLocal", "(II)Lanvil/core/Any;"));
      break;
View Full Code Here

    case GET_REF:
      int refclass = pool.addClass("anvil/core/AnyEscapedLocalRef");
      code.anew(refclass);
      code.dup();
      code.aload(_context.getFrameIndex());
      code.iconst(_depth);
      code.iconst(_index);
      code.invokespecial(pool.addMethodRef(refclass, "<init>", "(Lanvil/script/StackFrame;II)V"));
      break;
View Full Code Here

      code.iconst(_index);
      code.invokespecial(pool.addMethodRef(refclass, "<init>", "(Lanvil/script/StackFrame;II)V"));
      break;

    case GET_BOOLEAN:
      code.aload(_context.getFrameIndex());
      code.iconst(_depth);
      code.iconst(_index);
      code.invokevirtual(code.getPool().addMethodRef(context.TYPE_STACKFRAME,
        "getLocal", "(II)Lanvil/core/Any;"));
      context.any2boolean();
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.