org.jruby.compiler.ir.instructions
Class Instr
java.lang.Object
org.jruby.compiler.ir.instructions.Instr
- Direct Known Subclasses:
- AllocateBindingInstr, ExceptionRegionEndMarkerInstr, ExceptionRegionStartMarkerInstr, GetInstr, LoadFromBindingInstr, MultiOperandInstr, NoOperandInstr, OneOperandInstr, PutInstr, TwoOperandInstr, YieldInstr
public abstract class Instr
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
operation
public final Operation operation
result
public final Variable result
Instr
public Instr(Operation operation)
Instr
public Instr(Operation operation,
Variable result)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getResult
public Variable getResult()
getOperation
public Operation getOperation()
hasSideEffects
public boolean hasSideEffects()
canRaiseException
public boolean canRaiseException()
markDead
public void markDead()
isDead
public boolean isDead()
getOperands
public abstract Operand[] getOperands()
getUsedVariables
public java.util.List<Variable> getUsedVariables()
cloneForInlining
public abstract Instr cloneForInlining(InlinerInfo ii)
- Clone the instruction for inlining -- this will rename all variables (including local variables and self!)
and replace RECV_ARG and RETURN instructions to regular copy instructions,
simplifyOperands
public abstract void simplifyOperands(java.util.Map<Operand,Operand> valueMap)
- This method takes as input a map of operands to their values, and outputs
If the value map provides a value for any of the instruction's operands
this method is expected to replace the original operands with the simplified values.
It is not required that it do so -- code correctness is not compromised by failure
to simplify
simplifyAndGetResult
public Operand simplifyAndGetResult(java.util.Map<Operand,Operand> valueMap)
- This method takes as input a map of operands to their values, and outputs
the result of this instruction.
If the value map provides a value for any of the instruction's operands
the expectation is that the operand will be replaced with the simplified value.
It is not required that it do so -- code correctness is not compromised by failure
to simplify.
- Parameters:
valueMap
- Mapping from operands to their simplified values
interpret
public Label interpret(InterpreterContext interp,
IRubyObject self)
Copyright © 2002-2009 JRuby Team. All Rights Reserved.