class SyntaxTree::YARV::BasicBlock
instructions do not branch except for the last one.
This object represents a single basic block, wherein all contained
def each_with_length
Yield each instruction in this basic block along with its index from the
def each_with_length return enum_for(:each_with_length) unless block_given? length = block_start insns.each do |insn| yield insn, length length += insn.length end end
def initialize(block_start, insns)
def initialize(block_start, insns) @id = "block_#{block_start}" @block_start = block_start @insns = insns @incoming_blocks = [] @outgoing_blocks = [] end
def verify
checks that the only instruction in this basic block that branches is
This method is used to verify that the basic block is well formed. It
def verify insns[0...-1].each { |insn| raise unless insn.branch_targets.empty? } end