Class: SyntaxTree::YARV::PutObjectInt2Fix1

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

Instance Method Details

#==(other) ⇒ Object



4946
4947
4948
# File 'lib/syntax_tree/yarv/instructions.rb', line 4946

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

#call(vm) ⇒ Object



4966
4967
4968
# File 'lib/syntax_tree/yarv/instructions.rb', line 4966

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

#canonicalObject



4962
4963
4964
# File 'lib/syntax_tree/yarv/instructions.rb', line 4962

def canonical
  PutObject.new(1)
end

#deconstruct_keys(_keys) ⇒ Object



4942
4943
4944
# File 'lib/syntax_tree/yarv/instructions.rb', line 4942

def deconstruct_keys(_keys)
  {}
end

#disasm(fmt) ⇒ Object



4934
4935
4936
# File 'lib/syntax_tree/yarv/instructions.rb', line 4934

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

#lengthObject



4950
4951
4952
# File 'lib/syntax_tree/yarv/instructions.rb', line 4950

def length
  1
end

#popsObject



4954
4955
4956
# File 'lib/syntax_tree/yarv/instructions.rb', line 4954

def pops
  0
end

#pushesObject



4958
4959
4960
# File 'lib/syntax_tree/yarv/instructions.rb', line 4958

def pushes
  1
end

#to_a(_iseq) ⇒ Object



4938
4939
4940
# File 'lib/syntax_tree/yarv/instructions.rb', line 4938

def to_a(_iseq)
  [:putobject_INT2FIX_1_]
end