class SyntaxTree::YARV::OptAnd
### Summary
‘opt_and` is a specialization of the `opt_send_without_block` instruction that occurs when the `&` operator is used. There is a fast path for if both operands are integers. It pops both the receiver and the argument off the stack and pushes on the result.
### Usage
~~~ruby 2 & 3 ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2724 def initialize(calldata) @calldata = calldata end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2740 def ==(other) other.is_a?(OptAnd) && other.calldata == calldata end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2760 def call(vm) canonical.call(vm) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2756 def canonical Send.new(calldata, nil) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2736 def deconstruct_keys(_keys) { calldata: calldata } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2728 def disasm(fmt) fmt.instruction("opt_and", [fmt.calldata(calldata)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2732 def to_a(_iseq) [:opt_and, calldata.to_h] end