Examples of Operand


Examples of org.jruby.compiler.ir.operands.Operand

            return result;
        }
    }

    public Operand buildInstAsgn(final InstAsgnNode instAsgnNode, IRScope s) {
        Operand val = build(instAsgnNode.getValueNode(), s);
        // NOTE: if 's' happens to the a class, this is effectively an assignment of a class instance variable
        s.addInstr(new PutFieldInstr(getSelf(s), instAsgnNode.getName(), val));
        return val;
    }
View Full Code Here

Examples of org.jruby.compiler.ir.operands.Operand

        NodeType argsNodeId = BlockBody.getArgumentTypeWackyHack(iterNode);
        if ((iterNode.getVarNode() != null) && (argsNodeId != null))
            buildBlockArgsAssignment(iterNode.getVarNode(), closure, 0, false)// SSS: Changed this from 1 to 0

            // Build closure body and return the result of the closure
        Operand closureRetVal = iterNode.getBodyNode() == null ? Nil.NIL : build(iterNode.getBodyNode(), closure);
        if (closureRetVal != U_NIL// can be U_NIL if the node is an if node with returns in both branches.
            closure.addInstr(new ClosureReturnInstr(closureRetVal));

        return MetaObject.create(closure);
    }
View Full Code Here

Examples of org.jruby.compiler.ir.operands.Operand

    public Operand buildLiteral(LiteralNode literalNode, IRScope s) {
        return new StringLiteral(literalNode.getName());
    }

    public Operand buildLocalAsgn(LocalAsgnNode localAsgnNode, IRScope s) {
        Operand value = build(localAsgnNode.getValueNode(), s);
        s.addInstr(new CopyInstr(s.getLocalVariable(localAsgnNode.getName()), value));

        return value;
    }
View Full Code Here

Examples of org.jruby.compiler.ir.operands.Operand

    public Operand buildLocalVar(LocalVarNode node, IRScope s) {
        return s.getLocalVariable(node.getName());
    }

    public Operand buildMatch(MatchNode matchNode, IRScope m) {
        Operand regexp = build(matchNode.getRegexpNode(), m);
        return generateJRubyUtilityCall(m, MethAddr.MATCH, regexp, NO_ARGS);
    }
View Full Code Here

Examples of org.jruby.compiler.ir.operands.Operand

        Operand regexp = build(matchNode.getRegexpNode(), m);
        return generateJRubyUtilityCall(m, MethAddr.MATCH, regexp, NO_ARGS);
    }

    public Operand buildMatch2(Match2Node matchNode, IRScope m) {
        Operand receiver = build(matchNode.getReceiverNode(), m);
        Operand value    = build(matchNode.getValueNode(), m);
        return generateJRubyUtilityCall(m, MethAddr.MATCH2, receiver, new Operand[]{value});
    }
View Full Code Here

Examples of org.jruby.ir.operands.Operand

    @Override
    public Instr cloneForInlinedScope(InlinerInfo ii) {
        if (ii.canMapArgsStatically()) {
           int n = ii.getArgsCount();
           int remaining = n - preReqdArgsCount;
           Operand argVal;
           if (remaining <= argIndex) {
               // SSS: FIXME: Argh!
               argVal = ii.getInlineHostScope().getManager().getNil();
           } else {
               argVal = (remaining > postReqdArgsCount) ? ii.getArg(n - postReqdArgsCount + argIndex) : ii.getArg(preReqdArgsCount + argIndex);
View Full Code Here

Examples of org.objectweb.medor.expression.api.Operand

    if (!(op.getExpression(0) instanceof Operand
        && op.getExpression(1) instanceof Operand)) {
      return false;
    }
    Operand o0 = (Operand) op.getExpression(0);
    Operand o1 = (Operand) op.getExpression(1);
    if (o0.getType().getTypeCode() == PTypeSpace.STRING.getTypeCode()) {
      return true;
    } else if (o1.getType().getTypeCode() == PTypeSpace.STRING.getTypeCode()) {
      //reverse the order: column name at left
      op.setExpression(0, o1);
      op.setExpression(1, o0);
      return true;
    } else {
View Full Code Here

Examples of org.objectweb.medor.expression.api.Operand

        } else if (e instanceof Equal){
            Expression tmpe = ((Operator) e).getExpression(0);
            if (!(tmpe instanceof Operand)) {
                return false;
            }
            Operand op0 = (Operand) tmpe;
            tmpe = ((Operator) e).getExpression(1);
            if (!(tmpe instanceof Operand)) {
                return false;
            }
            Operand op1 = (Operand) tmpe;
            //Equal between two operand
            if (op0 instanceof FieldOperand) {
            } else if (op1 instanceof FieldOperand) {
                //revert if op1 is
                Operand o = op0;
                op0 = op1;
                op1 = o;
            } else {
                return false;
            }
View Full Code Here

Examples of wyvern.targets.Common.wyvernIL.IL.Imm.Operand

    return val;
  }

  @Override
  public BytecodeValue visit(BinOp binOp) {
    Operand l = binOp.getL();
    Operand r = binOp.getR();
    String op = binOp.getOp();
    BytecodeValue left = l.accept(opVisitor);
    BytecodeValue right = r.accept(opVisitor);
    return left.doInvoke(right, op);
  }
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.