class SyntaxTree::YARV::OptArefWith
### Summary
‘opt_aref_with` is a specialization of the `opt_aref` instruction that occurs when the `[]` operator is used with a string argument known at compile time. There are fast paths if the receiver is a hash. It pops the receiver off the stack and pushes on the result.
### Usage
~~~ruby ‘test’ => true ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2837 def initialize(object, calldata) @object = object @calldata = calldata end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2857 def ==(other) other.is_a?(OptArefWith) && other.object == object && other.calldata == calldata end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2874 def call(vm) vm.push(vm.pop[object]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2853 def deconstruct_keys(_keys) { object: object, calldata: calldata } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2842 def disasm(fmt) fmt.instruction( "opt_aref_with", [fmt.object(object), fmt.calldata(calldata)] ) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2849 def to_a(_iseq) [:opt_aref_with, object, calldata.to_h] end