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



4693
4694
4695
# File 'lib/syntax_tree/yarv/instructions.rb', line 4693

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

#call(vm) ⇒ Object



4705
4706
4707
# File 'lib/syntax_tree/yarv/instructions.rb', line 4705

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

#canonicalObject



4701
4702
4703
# File 'lib/syntax_tree/yarv/instructions.rb', line 4701

def canonical
  PutObject.new(0)
end

#deconstruct_keys(_keys) ⇒ Object



4689
4690
4691
# File 'lib/syntax_tree/yarv/instructions.rb', line 4689

def deconstruct_keys(_keys)
  {}
end

#disasm(fmt) ⇒ Object



4681
4682
4683
# File 'lib/syntax_tree/yarv/instructions.rb', line 4681

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

#pushesObject



4697
4698
4699
# File 'lib/syntax_tree/yarv/instructions.rb', line 4697

def pushes
  1
end

#side_effects?Boolean

Returns:

  • (Boolean)


4709
4710
4711
# File 'lib/syntax_tree/yarv/instructions.rb', line 4709

def side_effects?
  false
end

#to_a(_iseq) ⇒ Object



4685
4686
4687
# File 'lib/syntax_tree/yarv/instructions.rb', line 4685

def to_a(_iseq)
  [:putobject_INT2FIX_0_]
end