From 6ddc0f2c44c5f17c5c177820bde3e16ff73ca616 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 15 May 2026 11:52:24 +0200 Subject: [PATCH] Revert "Blua: opcode OP_SELF operate only with string keys, so they can use fast-track table access" This reverts commit 31a0433255c4f99b80650535478630aa5f341239. --- src/blua/lcode.c | 12 ------------ src/blua/lopcodes.h | 2 -- 2 files changed, 14 deletions(-) diff --git a/src/blua/lcode.c b/src/blua/lcode.c index 562ad3506..567b88500 100644 --- a/src/blua/lcode.c +++ b/src/blua/lcode.c @@ -626,20 +626,8 @@ static void codenot (FuncState *fs, expdesc *e) { removevalues(fs, e->t); } -/* -** Check whether expression 'e' is a literal string -*/ -static int isKstr (FuncState *fs, expdesc *e) { - return (e->k == VK && ttisstring(&fs->f->k[e->u.s.info])); -} -/* -** Create expression 't[k]'. 't' must have its final result already in a -** register or upvalue. Upvalues can only be indexed by literal strings. -*/ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { - if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non string? */ - luaK_exp2anyreg(fs, t); /* put it in a register */ t->u.s.aux = luaK_exp2RK(fs, k); t->k = VINDEXED; } diff --git a/src/blua/lopcodes.h b/src/blua/lopcodes.h index aa84da8d0..8b08b04e0 100644 --- a/src/blua/lopcodes.h +++ b/src/blua/lopcodes.h @@ -232,8 +232,6 @@ OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ (*) In OP_SETLIST, if (B == 0) then B = `top'; if (C == 0) then next `instruction' is real C - (*) In OP_SELF, the index must be a string. - (*) For comparisons, A specifies what condition the test should accept (true or false).