Minor tweak to FASTCALL3 instruction (#1548)

In all other places, L->top is extracted to a local when writing to
stack; this helps compilers without TBAA (MSVC) to not reload L->top
redundantly.

Also assert that we do in fact have 2 slots of stack space (which we
do).
This commit is contained in:
Arseny Kapoulkine 2024-11-28 00:07:37 +09:00 committed by GitHub
parent b5801d3377
commit 8f2ab4cbad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2923,10 +2923,13 @@ reentry:
{ {
VM_PROTECT_PC(); // f may fail due to OOM VM_PROTECT_PC(); // f may fail due to OOM
setobj2s(L, L->top, arg2); // note: it's safe to push arguments past top for complicated reasons (see top of the file)
setobj2s(L, L->top + 1, arg3); LUAU_ASSERT(L->top + 2 < L->stack + L->stacksize);
StkId top = L->top;
setobj2s(L, top, arg2);
setobj2s(L, top + 1, arg3);
int n = f(L, ra, arg1, nresults, L->top, nparams); int n = f(L, ra, arg1, nresults, top, nparams);
if (n >= 0) if (n >= 0)
{ {