class SyntaxTree::YARV::Swap
### Summary
‘swap` swaps the top two elements in the stack.
### TracePoint
‘swap` does not dispatch any events.
### Usage
~~~ruby !!defined?([]) ~~~
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5667 def ==(other) other.is_a?(Swap) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5679 def call(vm) left, right = vm.pop(2) vm.push(right, left) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5663 def deconstruct_keys(_keys) {} end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5655 def disasm(fmt) fmt.instruction("swap") end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5659 def to_a(_iseq) [:swap] end