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



4640
4641
4642
# File 'lib/syntax_tree/yarv/instructions.rb', line 4640

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

#call(vm) ⇒ Object



4652
4653
4654
# File 'lib/syntax_tree/yarv/instructions.rb', line 4652

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

#canonicalObject



4648
4649
4650
# File 'lib/syntax_tree/yarv/instructions.rb', line 4648

def canonical
  PutObject.new(0)
end

#deconstruct_keys(_keys) ⇒ Object



4636
4637
4638
# File 'lib/syntax_tree/yarv/instructions.rb', line 4636

def deconstruct_keys(_keys)
  {}
end

#disasm(fmt) ⇒ Object



4628
4629
4630
# File 'lib/syntax_tree/yarv/instructions.rb', line 4628

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

#pushesObject



4644
4645
4646
# File 'lib/syntax_tree/yarv/instructions.rb', line 4644

def pushes
  1
end

#side_effects?Boolean

Returns:

  • (Boolean)


4656
4657
4658
# File 'lib/syntax_tree/yarv/instructions.rb', line 4656

def side_effects?
  false
end

#to_a(_iseq) ⇒ Object



4632
4633
4634
# File 'lib/syntax_tree/yarv/instructions.rb', line 4632

def to_a(_iseq)
  [:putobject_INT2FIX_0_]
end