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
Public Class Methods
Source
# File lib/syntax_tree/yarv/legacy.rb, line 249 def initialize(cache) @cache = cache end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/legacy.rb, line 265 def ==(other) other.is_a?(OptSetInlineCache) && other.cache == cache end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 261 def deconstruct_keys(_keys) { cache: cache } end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 253 def disasm(fmt) fmt.instruction("opt_setinlinecache", [fmt.inline_storage(cache)]) end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 257 def to_a(_iseq) [:opt_setinlinecache, cache] end