Class: SyntaxTree::YARV::Pop

Inherits:
Instruction show all
Defined in:
lib/syntax_tree/yarv/instructions.rb

Overview

### Summary

‘pop` pops the top value off the stack.

### Usage

~~~ruby a ||= 2 ~~~

Instance Method Summary collapse

Methods inherited from Instruction

#branch_targets, #canonical, #falls_through?, #leaves?, #length, #pushes

Instance Method Details

#==(other) ⇒ Object



4504
4505
4506
# File 'lib/syntax_tree/yarv/instructions.rb', line 4504

def ==(other)
  other.is_a?(Pop)
end

#call(vm) ⇒ Object



4512
4513
4514
# File 'lib/syntax_tree/yarv/instructions.rb', line 4512

def call(vm)
  vm.pop
end

#deconstruct_keys(_keys) ⇒ Object



4500
4501
4502
# File 'lib/syntax_tree/yarv/instructions.rb', line 4500

def deconstruct_keys(_keys)
  {}
end

#disasm(fmt) ⇒ Object



4492
4493
4494
# File 'lib/syntax_tree/yarv/instructions.rb', line 4492

def disasm(fmt)
  fmt.instruction("pop")
end

#popsObject



4508
4509
4510
# File 'lib/syntax_tree/yarv/instructions.rb', line 4508

def pops
  1
end

#side_effects?Boolean

Returns:

  • (Boolean)


4516
4517
4518
# File 'lib/syntax_tree/yarv/instructions.rb', line 4516

def side_effects?
  false
end

#to_a(_iseq) ⇒ Object



4496
4497
4498
# File 'lib/syntax_tree/yarv/instructions.rb', line 4496

def to_a(_iseq)
  [:pop]
end