Class: SyntaxTree::YARV::PutObjectInt2Fix0

Inherits:
Object
  • 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

Instance Method Details

#==(other) ⇒ Object



4896
4897
4898
# File 'lib/syntax_tree/yarv/instructions.rb', line 4896

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

#call(vm) ⇒ Object



4916
4917
4918
# File 'lib/syntax_tree/yarv/instructions.rb', line 4916

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

#canonicalObject



4912
4913
4914
# File 'lib/syntax_tree/yarv/instructions.rb', line 4912

def canonical
  PutObject.new(0)
end

#deconstruct_keys(_keys) ⇒ Object



4892
4893
4894
# File 'lib/syntax_tree/yarv/instructions.rb', line 4892

def deconstruct_keys(_keys)
  {}
end

#disasm(fmt) ⇒ Object



4884
4885
4886
# File 'lib/syntax_tree/yarv/instructions.rb', line 4884

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

#lengthObject



4900
4901
4902
# File 'lib/syntax_tree/yarv/instructions.rb', line 4900

def length
  1
end

#popsObject



4904
4905
4906
# File 'lib/syntax_tree/yarv/instructions.rb', line 4904

def pops
  0
end

#pushesObject



4908
4909
4910
# File 'lib/syntax_tree/yarv/instructions.rb', line 4908

def pushes
  1
end

#to_a(_iseq) ⇒ Object



4888
4889
4890
# File 'lib/syntax_tree/yarv/instructions.rb', line 4888

def to_a(_iseq)
  [:putobject_INT2FIX_0_]
end