class SyntaxTree::YARV::OptSucc
### Summary
‘opt_succ` is a specialization of the `opt_send_without_block` instruction when the method being called is `succ`. Fast paths exist when the receiver is either a String or a Fixnum. It pops the receiver off the stack and pushes on the result.
### Usage
~~~ruby “”.succ ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4447 def initialize(calldata) @calldata = calldata end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4463 def ==(other) other.is_a?(OptSucc) && other.calldata == calldata end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4483 def call(vm) canonical.call(vm) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4479 def canonical Send.new(calldata, nil) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4459 def deconstruct_keys(_keys) { calldata: calldata } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4451 def disasm(fmt) fmt.instruction("opt_succ", [fmt.calldata(calldata)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4455 def to_a(_iseq) [:opt_succ, calldata.to_h] end