mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user