Late fixes

This commit is contained in:
Vyacheslav Egorov 2023-08-25 18:46:28 +03:00
parent 8cf13435c8
commit 51d4d18ec0
4 changed files with 14 additions and 5 deletions

View File

@ -605,6 +605,10 @@ void Unifier::tryUnify_(TypeId subTy, TypeId superTy, bool isFunctionCall, bool
{
// TODO: there are probably cheaper ways to check if any <: T.
const NormalizedType* superNorm = normalizer->normalize(superTy);
if (!superNorm)
return reportError(location, UnificationTooComplex{});
if (!log.get<AnyType>(superNorm->tops))
failure = true;
}

View File

@ -59,7 +59,8 @@ inline uint8_t getXmmRegisterCount(ABIX64 abi)
// Native code is as stackless as the interpreter, so we can place some data on the stack once and have it accessible at any point
// Stack is separated into sections for different data. See CodeGenX64.cpp for layout overview
constexpr unsigned kStackAlign = 8; // Bytes we need to align the stack for non-vol xmm register storage
constexpr unsigned kStackLocalStorage = 8 * kExtraLocals + 8 * kSpillSlots;
constexpr unsigned kStackLocalStorage = 8 * kExtraLocals;
constexpr unsigned kStackSpillStorage = 8 * kSpillSlots;
constexpr unsigned kStackExtraArgumentStorage = 2 * 8; // Bytes for 5th and 6th function call arguments used under Windows ABI
constexpr unsigned kStackRegHomeStorage = 4 * 8; // Register 'home' locations that can be used by callees under Windows ABI
@ -82,7 +83,7 @@ constexpr unsigned kStackOffsetToSpillSlots = kStackOffsetToLocals + kStackLocal
inline unsigned getFullStackSize(ABIX64 abi, uint8_t xmmRegCount)
{
return kStackOffsetToSpillSlots + getNonVolXmmStorageSize(abi, xmmRegCount) + kStackAlign;
return kStackOffsetToSpillSlots + kStackSpillStorage + getNonVolXmmStorageSize(abi, xmmRegCount) + kStackAlign;
}
constexpr OperandX64 sClosure = qword[rsp + kStackOffsetToLocals + 0]; // Closure* cl

View File

@ -412,6 +412,10 @@ static void obscureThrowCase(int64_t (*f)(int64_t, void (*)(int64_t)))
TEST_CASE("GeneratedCodeExecutionWithThrowX64Simd")
{
// This test requires AVX
if (!Luau::CodeGen::isSupported())
return;
using namespace X64;
AssemblyBuilderX64 build(/* logText= */ false);

View File

@ -49,9 +49,9 @@ TEST_CASE_FIXTURE(IrRegAllocX64Fixture, "RelocateFix")
LUAU_ASSERT(function.instructions[1].spilled);
checkMatch(R"(
vmovsd qword ptr [rsp+070h],rax
vmovsd qword ptr [rsp+078h],rax
vmovsd rax,qword ptr [rsp+070h]
vmovsd qword ptr [rsp+048h],rax
vmovsd qword ptr [rsp+050h],rax
vmovsd rax,qword ptr [rsp+048h]
)");
}