Skip to content

Commit 40eb333

Browse files
committed
v0.15.4+luau682
1 parent a214557 commit 40eb333

File tree

8 files changed

+32
-50
lines changed

8 files changed

+32
-50
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "luau0-src"
3-
version = "0.15.3+luau681"
3+
version = "0.15.4+luau682"
44
authors = ["Aleksandr Orlenko <[email protected]>"]
55
edition = "2021"
66
repository = "https://github.com/mlua-rs/luau-src-rs"

luau/Ast/src/Parser.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ LUAU_FASTINTVARIABLE(LuauParseErrorLimit, 100)
2020
LUAU_FASTFLAGVARIABLE(LuauSolverV2)
2121
LUAU_FASTFLAGVARIABLE(LuauDeclareExternType)
2222
LUAU_FASTFLAGVARIABLE(LuauParseStringIndexer)
23-
LUAU_FASTFLAGVARIABLE(LuauCSTForReturnTypeFunctionTail)
2423
LUAU_FASTFLAGVARIABLE(LuauParseAttributeFixUninit)
2524
LUAU_DYNAMIC_FASTFLAGVARIABLE(DebugLuauReportReturnTypeVariadicWithTypeSuffix, false)
2625

@@ -1903,10 +1902,8 @@ AstTypePack* Parser::parseReturnType()
19031902
// possibly () -> ReturnType
19041903
if (lexer.current().type != ')')
19051904
{
1906-
if (FFlag::LuauCSTForReturnTypeFunctionTail && options.storeCstData)
1905+
if (options.storeCstData)
19071906
varargAnnotation = parseTypeList(result, resultNames, &commaPositions, &nameColonPositions);
1908-
else if (options.storeCstData)
1909-
varargAnnotation = parseTypeList(result, resultNames, &commaPositions);
19101907
else
19111908
varargAnnotation = parseTypeList(result, resultNames);
19121909
}
@@ -1950,7 +1947,7 @@ AstTypePack* Parser::parseReturnType()
19501947
Position returnArrowPosition = lexer.current().location.begin;
19511948
AstType* tail = parseFunctionTypeTail(begin, {nullptr, 0}, {}, {}, copy(result), copy(resultNames), varargAnnotation);
19521949

1953-
if (FFlag::LuauCSTForReturnTypeFunctionTail && options.storeCstData && tail->is<AstTypeFunction>())
1950+
if (options.storeCstData && tail->is<AstTypeFunction>())
19541951
{
19551952
cstNodeMap[tail] = allocator.alloc<CstTypeFunction>(
19561953
Position{0, 0},

luau/CodeGen/include/Luau/IrData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ enum class IrCmd : uint8_t
392392
// C: Rn or unsigned int (key)
393393
SET_TABLE,
394394

395-
// TODO: remove with FFlagLuauCodeGenSimplifyImport
395+
// TODO: remove with FFlagLuauCodeGenSimplifyImport2
396396
// Lookup a value in the environment
397397
// A: Rn (where to store the result)
398398
// B: unsigned int (import path)

luau/CodeGen/src/IrLoweringA64.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,10 @@ void IrLoweringA64::lowerInst(IrInst& inst, uint32_t index, const IrBlock& next)
13841384
break;
13851385
case IrCmd::GET_CACHED_IMPORT:
13861386
{
1387+
regs.spill(build, index);
1388+
13871389
Label skip, exit;
1390+
13881391
RegisterA64 tempTag = regs.allocTemp(KindA64::w);
13891392

13901393
AddressA64 addrConstTag = tempAddr(inst.b, offsetof(TValue, tt));
@@ -1395,25 +1398,21 @@ void IrLoweringA64::lowerInst(IrInst& inst, uint32_t index, const IrBlock& next)
13951398
build.cbnz(tempTag, skip);
13961399

13971400
{
1398-
size_t spills = regs.spill(build, index);
1399-
14001401
build.mov(x0, rState);
14011402
build.add(x1, rBase, uint16_t(vmRegOp(inst.a) * sizeof(TValue)));
14021403
build.mov(w2, importOp(inst.c));
14031404
build.mov(w3, uintOp(inst.d));
14041405
build.ldr(x4, mem(rNativeContext, offsetof(NativeContext, getImport)));
14051406
build.blr(x4);
14061407

1407-
regs.restore(build, spills); // Need to restore before skip so that registers are in a consistent state
1408-
14091408
emitUpdateBase(build);
14101409
build.b(exit);
14111410
}
14121411

1413-
RegisterA64 tempTv = regs.allocTemp(KindA64::q);
1414-
14151412
build.setLabel(skip);
14161413

1414+
RegisterA64 tempTv = regs.allocTemp(KindA64::q);
1415+
14171416
AddressA64 addrConst = tempAddr(inst.b, 0);
14181417
build.ldr(tempTv, addrConst);
14191418

luau/CodeGen/src/IrLoweringX64.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,9 @@ void IrLoweringX64::lowerInst(IrInst& inst, uint32_t index, const IrBlock& next)
12211221
}
12221222
case IrCmd::GET_CACHED_IMPORT:
12231223
{
1224+
regs.assertAllFree();
1225+
regs.assertNoSpills();
1226+
12241227
Label skip, exit;
12251228

12261229
// If the constant for the import is set, we will use it directly, otherwise we have to call an import path lookup function
@@ -1241,9 +1244,10 @@ void IrLoweringX64::lowerInst(IrInst& inst, uint32_t index, const IrBlock& next)
12411244
emitUpdateBase(build);
12421245
build.jmp(exit);
12431246

1247+
build.setLabel(skip);
1248+
12441249
ScopedRegX64 tmp1{regs, SizeX64::xmmword};
12451250

1246-
build.setLabel(skip);
12471251
build.vmovups(tmp1.reg, luauConstant(vmConstOp(inst.b)));
12481252
build.vmovups(luauReg(vmRegOp(inst.a)), tmp1.reg);
12491253
build.setLabel(exit);

luau/CodeGen/src/IrTranslation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "lstate.h"
1313
#include "ltm.h"
1414

15-
LUAU_FASTFLAGVARIABLE(LuauCodeGenSimplifyImport)
15+
LUAU_FASTFLAGVARIABLE(LuauCodeGenSimplifyImport2)
1616

1717
namespace Luau
1818
{
@@ -1217,7 +1217,7 @@ void translateInstGetImport(IrBuilder& build, const Instruction* pc, int pcpos)
12171217
int k = LUAU_INSN_D(*pc);
12181218
uint32_t aux = pc[1];
12191219

1220-
if (FFlag::LuauCodeGenSimplifyImport)
1220+
if (FFlag::LuauCodeGenSimplifyImport2)
12211221
{
12221222
build.inst(IrCmd::CHECK_SAFE_ENV, build.vmExit(pcpos));
12231223
build.inst(IrCmd::GET_CACHED_IMPORT, build.vmReg(ra), build.vmConst(k), build.constImport(aux), build.constUint(pcpos + 1));

luau/CodeGen/src/OptimizeConstProp.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,8 @@ static void constPropInInst(ConstPropState& state, IrBuilder& build, IrFunction&
15451545
// Outside of safe environment, environment traversal for an import can execute custom code
15461546
if (!state.inSafeEnv)
15471547
state.invalidateUserCall();
1548+
1549+
state.invalidateValuePropagation();
15481550
break;
15491551
case IrCmd::CONCAT:
15501552
state.invalidateRegisterRange(vmRegOp(inst.a), function.uintOp(inst.b));

luau/Compiler/src/Compiler.cpp

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,40 +4300,20 @@ void compileOrThrow(BytecodeBuilder& bytecode, const ParseResult& parseResult, c
43004300
}
43014301

43024302
// computes type information for all functions based on type annotations
4303-
if (FFlag::LuauSeparateCompilerTypeInfo)
4304-
{
4305-
if (options.typeInfoLevel >= 1 || options.optimizationLevel >= 2)
4306-
buildTypeMap(
4307-
compiler.functionTypes,
4308-
compiler.localTypes,
4309-
compiler.exprTypes,
4310-
root,
4311-
options.vectorType,
4312-
compiler.userdataTypes,
4313-
compiler.builtinTypes,
4314-
compiler.builtins,
4315-
compiler.globals,
4316-
options.libraryMemberTypeCb,
4317-
bytecode
4318-
);
4319-
}
4320-
else
4321-
{
4322-
if (options.typeInfoLevel >= 1)
4323-
buildTypeMap(
4324-
compiler.functionTypes,
4325-
compiler.localTypes,
4326-
compiler.exprTypes,
4327-
root,
4328-
options.vectorType,
4329-
compiler.userdataTypes,
4330-
compiler.builtinTypes,
4331-
compiler.builtins,
4332-
compiler.globals,
4333-
options.libraryMemberTypeCb,
4334-
bytecode
4335-
);
4336-
}
4303+
if (options.typeInfoLevel >= 1 || options.optimizationLevel >= 2)
4304+
buildTypeMap(
4305+
compiler.functionTypes,
4306+
compiler.localTypes,
4307+
compiler.exprTypes,
4308+
root,
4309+
options.vectorType,
4310+
compiler.userdataTypes,
4311+
compiler.builtinTypes,
4312+
compiler.builtins,
4313+
compiler.globals,
4314+
options.libraryMemberTypeCb,
4315+
bytecode
4316+
);
43374317

43384318
for (AstExprFunction* expr : functions)
43394319
{

0 commit comments

Comments
 (0)