class SyntaxTree::YARV::Legacy::OptSetInlineCache

### Summary

‘opt_setinlinecache` sets an inline cache for a constant lookup. It pops the value it should set off the top of the stack. It uses this value to set the cache. It then pushes that value back onto the top of the stack.

This instruction is no longer used since in Ruby 3.2 it was replaced by the consolidated ‘opt_getconstant_path` instruction.

### Usage

~~~ruby Constant ~~~

Attributes

cache[R]

Public Class Methods

new(cache) click to toggle source
# File lib/syntax_tree/yarv/legacy.rb, line 249
def initialize(cache)
  @cache = cache
end

Public Instance Methods

==(other) click to toggle source
# File lib/syntax_tree/yarv/legacy.rb, line 265
def ==(other)
  other.is_a?(OptSetInlineCache) && other.cache == cache
end
call(vm) click to toggle source
# File lib/syntax_tree/yarv/legacy.rb, line 281
def call(vm)
end
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/yarv/legacy.rb, line 261
def deconstruct_keys(_keys)
  { cache: cache }
end
disasm(fmt) click to toggle source
# File lib/syntax_tree/yarv/legacy.rb, line 253
def disasm(fmt)
  fmt.instruction("opt_setinlinecache", [fmt.inline_storage(cache)])
end
length() click to toggle source
# File lib/syntax_tree/yarv/legacy.rb, line 269
def length
  2
end
pops() click to toggle source
# File lib/syntax_tree/yarv/legacy.rb, line 273
def pops
  1
end
pushes() click to toggle source
# File lib/syntax_tree/yarv/legacy.rb, line 277
def pushes
  1
end
to_a(_iseq) click to toggle source
# File lib/syntax_tree/yarv/legacy.rb, line 257
def to_a(_iseq)
  [:opt_setinlinecache, cache]
end