Class: SyntaxTree::YARV::Nop
- Inherits:
-
Object
- Object
- SyntaxTree::YARV::Nop
- Defined in:
- lib/syntax_tree/yarv/instructions.rb
Overview
### Summary
nop is a no-operation instruction. It is used to pad the instruction sequence so there is a place for other instructions to jump to.
### Usage
~~~ruby raise rescue true ~~~
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
2708 2709 2710 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2708 def ==(other) other.is_a?(Nop) end |
#call(vm) ⇒ Object
2728 2729 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2728 def call(vm) end |
#canonical ⇒ Object
2724 2725 2726 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2724 def canonical self end |
#deconstruct_keys(_keys) ⇒ Object
2704 2705 2706 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2704 def deconstruct_keys(_keys) {} end |
#disasm(fmt) ⇒ Object
2696 2697 2698 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2696 def disasm(fmt) fmt.instruction("nop") end |
#length ⇒ Object
2712 2713 2714 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2712 def length 1 end |
#pops ⇒ Object
2716 2717 2718 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2716 def pops 0 end |
#pushes ⇒ Object
2720 2721 2722 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2720 def pushes 0 end |
#to_a(_iseq) ⇒ Object
2700 2701 2702 |
# File 'lib/syntax_tree/yarv/instructions.rb', line 2700 def to_a(_iseq) [:nop] end |