ops.h: rename OP_LOADT/OP_LOADF to OP_LOADTRUE/OP_LOADFALSE

Rename boolean load opcodes for consistency with LOADNIL/LOADSELF.
Backward compatibility aliases are provided in opcode.h.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-01-23 21:51:01 +09:00
parent 60d981dbc8
commit a1567be5da
6 changed files with 30 additions and 26 deletions
+2 -2
View File
@@ -4224,9 +4224,9 @@ static const mrb_code neq_iseq[] = {
OP_ENTER, 0x4, 0, 0, // 000 OP_ENTER 1:0:0:0:0:0:0
OP_EQ, 0, // 004 OP_EQ R0 (R1)
OP_JMPNOT, 0, 0, 5, // 006 OP_JMPNOT R0 015
OP_LOADF, 0, // 010 OP_LOADF R0 (false)
OP_LOADFALSE, 0, // 010 OP_LOADFALSE R0 (false)
OP_JMP, 0, 2, // 012 OP_JMP 017
OP_LOADT, 0, // 015 OP_LOADT R0 (true)
OP_LOADTRUE, 0, // 015 OP_LOADTRUE R0 (true)
OP_RETURN, 0 // 017 OP_RETURN R0
};
+4 -4
View File
@@ -236,12 +236,12 @@ codedump(mrb_state *mrb, const mrb_irep *irep, FILE *out)
fprintf(out, "LOADSELF\tR%d\t(R0)", a);
print_lv_a(mrb, irep, a, out);
break;
CASE(OP_LOADT, B):
fprintf(out, "LOADT\t\tR%d\t(true)", a);
CASE(OP_LOADTRUE, B):
fprintf(out, "LOADTRUE\tR%d\t(true)", a);
print_lv_a(mrb, irep, a, out);
break;
CASE(OP_LOADF, B):
fprintf(out, "LOADF\t\tR%d\t(false)", a);
CASE(OP_LOADFALSE, B):
fprintf(out, "LOADFALSE\tR%d\t(false)", a);
print_lv_a(mrb, irep, a, out);
break;
CASE(OP_GETGV, BB):
+2 -2
View File
@@ -1815,12 +1815,12 @@ RETRY_TRY_BLOCK:
NEXT;
}
CASE(OP_LOADT, B) {
CASE(OP_LOADTRUE, B) {
SET_TRUE_VALUE(regs[a]);
NEXT;
}
CASE(OP_LOADF, B) {
CASE(OP_LOADFALSE, B) {
SET_FALSE_VALUE(regs[a]);
NEXT;
}