class SyntaxTree::YARV::Instruction
convenience methods for working with instructions.
This is a base class for all YARV instructions. It provides a few
def branch_targets
def branch_targets [] end
def canonical
(non-specialized) form of this instruction. If this instruction is not
This method creates an instruction that represents the canonical
def canonical self end
def falls_through?
Whether or not this instruction falls through to the next instruction if
def falls_through? false end
def leaves?
def leaves? false end
def length
it occupies in the instruction sequence. Effectively this is 1 plus the
This returns the size of the instruction in terms of the number of slots
def length 1 end
def pops
def pops 0 end
def pushes
def pushes 0 end
def side_effects?
side-effect, as do some special-case instructions like Leave. By default
Does the instruction have side effects? Control-flow counts as a
def side_effects? true end