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

==(other) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 5520
def ==(other)
  other.is_a?(Swap)
end
call(vm) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 5532
def call(vm)
  left, right = vm.pop(2)
  vm.push(right, left)
end
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 5516
def deconstruct_keys(_keys)
  {}
end
disasm(fmt) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 5508
def disasm(fmt)
  fmt.instruction("swap")
end
pops() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 5524
def pops
  2
end
pushes() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 5528
def pushes
  2
end
to_a(_iseq) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 5512
def to_a(_iseq)
  [:swap]
end