Class: SyntaxTree::YARV::PutObjectInt2Fix0

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

Overview

### Summary

‘putobject_INT2FIX_0_` pushes 0 on the stack. It is a specialized instruction resulting from the operand unification optimization. It is equivalent to `putobject 0`.

### Usage

~~~ruby 0 ~~~

Instance Method Summary collapse

Methods inherited from Instruction

#branch_targets, #falls_through?, #leaves?, #length, #pops

Instance Method Details

#==(other) ⇒ Object



4594
4595
4596
# File 'lib/syntax_tree/yarv/instructions.rb', line 4594

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

#call(vm) ⇒ Object



4606
4607
4608
# File 'lib/syntax_tree/yarv/instructions.rb', line 4606

def call(vm)
  canonical.call(vm)
end

#canonicalObject



4602
4603
4604
# File 'lib/syntax_tree/yarv/instructions.rb', line 4602

def canonical
  PutObject.new(0)
end

#deconstruct_keys(_keys) ⇒ Object



4590
4591
4592
# File 'lib/syntax_tree/yarv/instructions.rb', line 4590

def deconstruct_keys(_keys)
  {}
end

#disasm(fmt) ⇒ Object



4582
4583
4584
# File 'lib/syntax_tree/yarv/instructions.rb', line 4582

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

#pushesObject



4598
4599
4600
# File 'lib/syntax_tree/yarv/instructions.rb', line 4598

def pushes
  1
end

#side_effects?Boolean

Returns:

  • (Boolean)


4610
4611
4612
# File 'lib/syntax_tree/yarv/instructions.rb', line 4610

def side_effects?
  false
end

#to_a(_iseq) ⇒ Object



4586
4587
4588
# File 'lib/syntax_tree/yarv/instructions.rb', line 4586

def to_a(_iseq)
  [:putobject_INT2FIX_0_]
end