vm: add OP_BLKCALL for direct block call without method dispatch

Bypass method dispatch when calling blocks via yield. The new OP_BLKCALL
instruction directly invokes the proc without looking up Proc#call,
resulting in 13-17% faster yield performance.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-01-22 08:39:27 +09:00
parent 44f6cf4b4e
commit 52bee49ad2
5 changed files with 64 additions and 1 deletions
+3
View File
@@ -351,6 +351,9 @@ codedump(mrb_state *mrb, const mrb_irep *irep, FILE *out)
CASE(OP_CALL, Z):
fprintf(out, "CALL\n");
break;
CASE(OP_BLKCALL, BB):
fprintf(out, "BLKCALL\t\tR%d\t%d\n", a, b);
break;
CASE(OP_SUPER, BB):
fprintf(out, "SUPER\t\tR%d\t", a);
print_args(b, out);