class SyntaxTree::YARV::OptAref
### Summary
‘opt_aref` is a specialization of the `opt_send_without_block` instruction that occurs when the `[]` operator is used. There are fast paths if the receiver is an integer, array, or hash.
### Usage
~~~ruby 7 ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2780 def initialize(calldata) @calldata = calldata end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2796 def ==(other) other.is_a?(OptAref) && other.calldata == calldata end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2816 def call(vm) canonical.call(vm) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2812 def canonical Send.new(calldata, nil) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2792 def deconstruct_keys(_keys) { calldata: calldata } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2784 def disasm(fmt) fmt.instruction("opt_aref", [fmt.calldata(calldata)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2788 def to_a(_iseq) [:opt_aref, calldata.to_h] end