class SyntaxTree::YARV::InvokeSuper
~~~
end
super
def foo
~~~ruby
### Usage
pushes the return value onto the stack.
the super method. It pops the receiver and arguments off the stack and
`invokesuper` is similar to the ‘send` instruction, except that it calls
### Summary
def ==(other)
def ==(other) other.is_a?(InvokeSuper) && other.calldata == calldata && other.block_iseq == block_iseq end
def call(vm)
def call(vm) block = if (iseq = block_iseq) frame = vm.frame ->(*args, **kwargs, &blk) do vm.run_block_frame(iseq, frame, *args, **kwargs, &blk) end end keywords = if calldata.kw_arg calldata.kw_arg.zip(vm.pop(calldata.kw_arg.length)).to_h else {} end arguments = vm.pop(calldata.argc) receiver = vm.pop method = receiver.method(vm.frame.name).super_method vm.push(method.call(*arguments, **keywords, &block)) end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { calldata: calldata, block_iseq: block_iseq } end
def disasm(fmt)
def disasm(fmt) fmt.enqueue(block_iseq) if block_iseq fmt.instruction( "invokesuper", [fmt.calldata(calldata), block_iseq&.name || "nil"] ) end
def initialize(calldata, block_iseq)
def initialize(calldata, block_iseq) @calldata = calldata @block_iseq = block_iseq end
def pops
def pops argb = (calldata.flag?(CallData::CALL_ARGS_BLOCKARG) ? 1 : 0) argb + calldata.argc + 1 end
def pushes
def pushes 1 end
def to_a(_iseq)
def to_a(_iseq) [:invokesuper, calldata.to_h, block_iseq&.to_a] end