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



4458
4459
4460
# File 'lib/syntax_tree/yarv/instructions.rb', line 4458

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

#call(vm) ⇒ Object



4466
4467
4468
# File 'lib/syntax_tree/yarv/instructions.rb', line 4466

def call(vm)
  vm.pop
end

#deconstruct_keys(_keys) ⇒ Object



4454
4455
4456
# File 'lib/syntax_tree/yarv/instructions.rb', line 4454

def deconstruct_keys(_keys)
  {}
end

#disasm(fmt) ⇒ Object



4446
4447
4448
# File 'lib/syntax_tree/yarv/instructions.rb', line 4446

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

#popsObject



4462
4463
4464
# File 'lib/syntax_tree/yarv/instructions.rb', line 4462

def pops
  1
end

#side_effects?Boolean

Returns:

  • (Boolean)


4470
4471
4472
# File 'lib/syntax_tree/yarv/instructions.rb', line 4470

def side_effects?
  false
end

#to_a(_iseq) ⇒ Object



4450
4451
4452
# File 'lib/syntax_tree/yarv/instructions.rb', line 4450

def to_a(_iseq)
  [:pop]
end