Class: JIT::Function::Loop
- Inherits:
-
Object
- Object
- JIT::Function::Loop
- Defined in:
- lib/jit/function.rb
Overview
:nodoc:
Instance Method Summary collapse
- #break ⇒ Object
- #do(&block) ⇒ Object
- #end ⇒ Object
-
#initialize(function, start_label, done_label) ⇒ Loop
constructor
A new instance of Loop.
- #redo ⇒ Object
- #redo_from_here ⇒ Object
Constructor Details
#initialize(function, start_label, done_label) ⇒ Loop
Returns a new instance of Loop.
150 151 152 153 154 155 |
# File 'lib/jit/function.rb', line 150 def initialize(function, start_label, done_label) @function = function @start_label = start_label @redo_label = start_label @done_label = done_label end |
Instance Method Details
#break ⇒ Object
167 168 169 |
# File 'lib/jit/function.rb', line 167 def break @function.insn_branch(@done_label) end |
#do(&block) ⇒ Object
157 158 159 160 |
# File 'lib/jit/function.rb', line 157 def do(&block) block.call(self) return self end |
#end ⇒ Object
162 163 164 165 |
# File 'lib/jit/function.rb', line 162 def end @function.insn_branch(@start_label) @function.insn_label(@done_label) end |
#redo ⇒ Object
171 172 173 |
# File 'lib/jit/function.rb', line 171 def redo @function.insn_branch(@redo_label) end |