Class: SyntaxTree::YARV::Leave
- Inherits:
-
Object
- Object
- SyntaxTree::YARV::Leave
- Defined in:
- lib/syntax_tree/yarv/instructions.rb
Overview
### Summary
leave exits the current frame.
### Usage
~~~ruby ;; ~~~
Instance Method Summary collapse
- #==(other) ⇒ Object
- #call(vm) ⇒ Object
- #canonical ⇒ Object
- #deconstruct_keys(_keys) ⇒ Object
- #disasm(fmt) ⇒ Object
- #length ⇒ Object
- #pops ⇒ Object
- #pushes ⇒ Object
- #to_a(_iseq) ⇒ Object
Instance Method Details
#==(other) ⇒ Object
2428 2429 2430 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2428 def ==(other) other.is_a?(Leave) end |
#call(vm) ⇒ Object
2450 2451 2452 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2450 def call(vm) vm.leave end |
#canonical ⇒ Object
2446 2447 2448 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2446 def canonical self end |
#deconstruct_keys(_keys) ⇒ Object
2424 2425 2426 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2424 def deconstruct_keys(_keys) {} end |
#disasm(fmt) ⇒ Object
2416 2417 2418 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2416 def disasm(fmt) fmt.instruction("leave") end |
#length ⇒ Object
2432 2433 2434 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2432 def length 1 end |
#pops ⇒ Object
2436 2437 2438 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2436 def pops 1 end |
#pushes ⇒ Object
2440 2441 2442 2443 2444 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2440 def pushes # TODO: This is wrong. It should be 1. But it's 0 for now because # otherwise the stack size is incorrectly calculated. 0 end |
#to_a(_iseq) ⇒ Object
2420 2421 2422 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2420 def to_a(_iseq) [:leave] end |