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

calldata[R]

Public Class Methods

new(calldata) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4394
def initialize(calldata)
  @calldata = calldata
end

Public Instance Methods

==(other) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4410
def ==(other)
  other.is_a?(OptSucc) && other.calldata == calldata
end
call(vm) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4430
def call(vm)
  canonical.call(vm)
end
canonical() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4426
def canonical
  Send.new(calldata, nil)
end
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4406
def deconstruct_keys(_keys)
  { calldata: calldata }
end
disasm(fmt) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4398
def disasm(fmt)
  fmt.instruction("opt_succ", [fmt.calldata(calldata)])
end
length() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4414
def length
  2
end
pops() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4418
def pops
  1
end
pushes() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4422
def pushes
  1
end
to_a(_iseq) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4402
def to_a(_iseq)
  [:opt_succ, calldata.to_h]
end