class SyntaxTree::YARV::Legacy::OptGetInlineCache
### Summary
‘opt_getinlinecache` is a wrapper around a series of `putobject` and `getconstant` instructions that allows skipping past them if the inline cache is currently set. It pushes the value of the cache onto the stack if it is set, otherwise it pushes `nil`.
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 81 def initialize(label, cache) @label = label @cache = cache end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/legacy.rb, line 101 def ==(other) other.is_a?(OptGetInlineCache) && other.label == label && other.cache == cache end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 118 def branch_targets [label] end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 97 def deconstruct_keys(_keys) { label: label, cache: cache } end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 86 def disasm(fmt) fmt.instruction( "opt_getinlinecache", [fmt.label(label), fmt.inline_storage(cache)] ) end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 122 def falls_through? true end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 93 def to_a(_iseq) [:opt_getinlinecache, label.name, cache] end