Class: SyntaxTree::YARV::PutObjectInt2Fix1

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

Overview

### Summary

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

### Usage

~~~ruby 1 ~~~

Instance Method Summary collapse

Methods inherited from Instruction

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

Instance Method Details

#==(other) ⇒ Object



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

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

#call(vm) ⇒ Object



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

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

#canonicalObject



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

def canonical
  PutObject.new(1)
end

#deconstruct_keys(_keys) ⇒ Object



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

def deconstruct_keys(_keys)
  {}
end

#disasm(fmt) ⇒ Object



4674
4675
4676
# File 'lib/syntax_tree/yarv/instructions.rb', line 4674

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

#pushesObject



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

def pushes
  1
end

#side_effects?Boolean

Returns:

  • (Boolean)


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

def side_effects?
  false
end

#to_a(_iseq) ⇒ Object



4678
4679
4680
# File 'lib/syntax_tree/yarv/instructions.rb', line 4678

def to_a(_iseq)
  [:putobject_INT2FIX_1_]
end