mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
vm: add OP_SEND0 and OP_SSEND0 for zero-argument method calls
These opcodes use BB format instead of BBB, saving 1 byte per call. In the standard library, this saves ~790 bytes (568 SEND0 + 222 SSEND0). Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -60,8 +60,10 @@ OPCODE(RESCUE, BB) /* R[b] = R[a].isa?(R[b]) */
|
||||
OPCODE(RAISEIF, B) /* raise(R[a]) if R[a] */
|
||||
OPCODE(MATCHERR, B) /* raise NoMatchingPatternError unless R[a] */
|
||||
OPCODE(SSEND, BBB) /* R[a] = self.send(Syms[b],R[a+1]..,R[a+n+1]:R[a+n+2]..) (c=n|k<<4) */
|
||||
OPCODE(SSEND0, BB) /* R[a] = self.send(Syms[b]) (no args) */
|
||||
OPCODE(SSENDB, BBB) /* R[a] = self.send(Syms[b],R[a+1]..,R[a+n+1]:R[a+n+2]..,&R[a+n+2k+1]) */
|
||||
OPCODE(SEND, BBB) /* R[a] = R[a].send(Syms[b],R[a+1]..,R[a+n+1]:R[a+n+2]..) (c=n|k<<4) */
|
||||
OPCODE(SEND0, BB) /* R[a] = R[a].send(Syms[b]) (no args) */
|
||||
OPCODE(SENDB, BBB) /* R[a] = R[a].send(Syms[b],R[a+1]..,R[a+n+1]:R[a+n+2]..,&R[a+n+2k+1]) */
|
||||
OPCODE(CALL, Z) /* self.call(*, **, &) (But overlay the current call frame; tailcall) */
|
||||
OPCODE(BLKCALL, BB) /* R[a] = R[a].call(R[a+1],... ,R[a+b]); direct block call */
|
||||
|
||||
Reference in New Issue
Block a user