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



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

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

#call(vm) ⇒ Object



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

def call(vm)
  vm.pop
end

#deconstruct_keys(_keys) ⇒ Object



4442
4443
4444
# File 'lib/syntax_tree/yarv/instructions.rb', line 4442

def deconstruct_keys(_keys)
  {}
end

#disasm(fmt) ⇒ Object



4434
4435
4436
# File 'lib/syntax_tree/yarv/instructions.rb', line 4434

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

#popsObject



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

def pops
  1
end

#side_effects?Boolean

Returns:

  • (Boolean)


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

def side_effects?
  false
end

#to_a(_iseq) ⇒ Object



4438
4439
4440
# File 'lib/syntax_tree/yarv/instructions.rb', line 4438

def to_a(_iseq)
  [:pop]
end