Package anvil.codec

Examples of anvil.codec.Code.astore()


    switch(child.typeOf()) {
    case Node.EXPR_VARIABLE:
      {
        final int tmp = code.addLocal();
        child.compile(context, GET);
        code.astore(tmp);
        child.compile(context, new Node() {
          public void compile(ByteCompiler context, int operation)
          {
            Code code_ = context.getCode();
            code_.aload(tmp);
View Full Code Here


      if (_expression.needLineNumbers()) {
        context.location(_expression.getLocation());
      }
      rv = code.addLocal();
      _expression.compile(context, Expression.GET);
      code.astore(rv);
    }
    boolean blocked = false;
    Statement stmt = this;
    while(!blocked && stmt!=null) {
      blocked = stmt.callFinalizer();
View Full Code Here

      code.swap();
      code.invokevirtual(pool.addMethodRef("anvil/script/StackFrame",
        "push", "(Lanvil/core/Any;)V"));

      _framelocal = code.addLocal();
      code.astore(_framelocal);

      ExceptionHandler handler = code.startExceptionHandler(true);
      _handler = handler;
      Target tostart = code.getTarget();
      if (_start != null) {
View Full Code Here

      }
      handler.endProtectedRegion();

      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

       _handler = null;

      // finally
      handler.startFinally();
      int returnto = code.addLocal();
      code.astore(returnto);
      code.aload_first();
      code.invokevirtual(contextframe);
      code.invokevirtual(pool.addMethodRef("anvil/script/StackFrame",
        "pop", "()Lanvil/core/Any;"));
      code.pop();
View Full Code Here

    if (n == 1) {
      compile(context, getChild(0), getChild(1));
    } else {
      final int tmp = code.addLocal();
      getChild(n).compile(context, GET);
      code.astore(tmp);
      final int nth = code.getPool().addMethodRef(context.TYPE_CONTEXT,
        "nth", "(Lanvil/core/Any;I)Lanvil/core/Any;");
      for(int i=0; i<n; i++) {
        final int c = i;
        compile(context, getChild(i), new Node() {
View Full Code Here

      code.invokevirtual(code.getPool().addMethodRef("anvil/script/StackFrame",
        "setLocal", "(ILanvil/core/Any;)Lanvil/core/Any;"));
    } else {
      child.compile(context, GET);
      code.dup();
      code.astore(_local.getIndex());
    }
  }
 

  public void compile(ByteCompiler context, int operation)
View Full Code Here

      code.istore(l_length);
      code.iload(l_length);
      code.iconst(1);
      code.iadd();
      code.anewarray(context.TYPE_ANY);
      code.astore(l_newparameters);
      code.aload(l_parameters);
      code.iconst(0);
      code.aload(l_newparameters);
      code.iconst(1);
      code.iload(l_length);
View Full Code Here

      code.addLocals(parameters);
    }
    if (getContext) {
      contextindex = code.addLocal();
      code.invokestatic(pool.addMethodRef(context.TYPE_CONTEXT, "getInstance", "()Lanvil/script/Context;"));
      code.astore(contextindex);
    }
    code.self();
    context.compileArgumentList(function, nodes, contextindex);
    code.invokevirtual(function.getTypeRef(pool));
    if (toType > 0) {
View Full Code Here

  {
    Code code = context.getCode();
    _index = code.addLocal();
    if (!_escaped) {
      code.getstatic(code.getPool().addFieldRef(context.TYPE_ANY, "UNDEFINED", "Lanvil/core/Any;"));
      code.astore(_index);
    }
  }

  public int getTypeRef(ConstantPool pool)
  {
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.