Skip to content

Commit cd91a9f

Browse files
committed
v0.15.8+luau693
1 parent 66b483d commit cd91a9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1634
-345
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.7+luau690"
3+
version = "0.15.8+luau693"
44
authors = ["Aleksandr Orlenko <[email protected]>"]
55
edition = "2021"
66
repository = "https://github.com/mlua-rs/luau-src-rs"

luau/Ast/include/Luau/Ast.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ class AstAttr : public AstNode
195195
Checked,
196196
Native,
197197
Deprecated,
198+
Unknown
198199
};
199200

200201
struct DeprecatedInfo
@@ -205,6 +206,7 @@ class AstAttr : public AstNode
205206
};
206207

207208
AstAttr(const Location& location, Type type, AstArray<AstExpr*> args);
209+
AstAttr(const Location& location, Type type, AstArray<AstExpr*> args, AstName name);
208210

209211
AstAttr* asAttr() override
210212
{
@@ -217,6 +219,7 @@ class AstAttr : public AstNode
217219

218220
Type type;
219221
AstArray<AstExpr*> args;
222+
AstName name;
220223
};
221224

222225
class AstExpr : public AstNode

luau/Ast/include/Luau/Lexer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class AstNameTable
136136
std::pair<AstName, Lexeme::Type> getOrAddWithType(const char* name, size_t length);
137137
std::pair<AstName, Lexeme::Type> getWithType(const char* name, size_t length) const;
138138

139+
AstName getOrAdd(const char* name, size_t len);
139140
AstName getOrAdd(const char* name);
140141
AstName get(const char* name) const;
141142

luau/Ast/src/Ast.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ AstAttr::AstAttr(const Location& location, Type type, AstArray<AstExpr*> args)
5454
{
5555
}
5656

57+
AstAttr::AstAttr(const Location& location, Type type, AstArray<AstExpr*> args, AstName name)
58+
: AstNode(ClassIndex(), location)
59+
, type(type)
60+
, args(args)
61+
, name(name)
62+
{
63+
}
64+
5765
void AstAttr::visit(AstVisitor* visitor)
5866
{
5967
visitor->visit(this);

luau/Ast/src/Lexer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ std::pair<AstName, Lexeme::Type> AstNameTable::getWithType(const char* name, siz
253253
return std::make_pair(AstName(), Lexeme::Name);
254254
}
255255

256+
AstName AstNameTable::getOrAdd(const char* name, size_t len)
257+
{
258+
return getOrAddWithType(name, len).first;
259+
}
260+
256261
AstName AstNameTable::getOrAdd(const char* name)
257262
{
258263
return getOrAddWithType(name, strlen(name)).first;

luau/Ast/src/Parser.cpp

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ LUAU_DYNAMIC_FASTFLAGVARIABLE(DebugLuauReportReturnTypeVariadicWithTypeSuffix, f
2222
LUAU_FASTFLAGVARIABLE(LuauParseIncompleteInterpStringsWithLocation)
2323
LUAU_FASTFLAGVARIABLE(LuauParametrizedAttributeSyntax)
2424
LUAU_FASTFLAGVARIABLE(DebugLuauStringSingletonBasedOnQuotes)
25+
LUAU_FASTFLAGVARIABLE(LuauAutocompleteAttributes)
2526

2627
// Clip with DebugLuauReportReturnTypeVariadicWithTypeSuffix
2728
bool luau_telemetry_parsed_return_type_variadic_with_type_suffix = false;
@@ -934,8 +935,15 @@ void Parser::parseAttribute(TempVector<AstAttr*>& attributes)
934935

935936
nextLexeme();
936937

937-
if (type)
938-
attributes.push_back(allocator.alloc<AstAttr>(loc, *type, empty));
938+
if (FFlag::LuauAutocompleteAttributes)
939+
{
940+
attributes.push_back(allocator.alloc<AstAttr>(loc, type.value_or(AstAttr::Type::Unknown), empty, AstName(name)));
941+
}
942+
else
943+
{
944+
if (type)
945+
attributes.push_back(allocator.alloc<AstAttr>(loc, *type, empty));
946+
}
939947
}
940948
else
941949
{
@@ -965,14 +973,30 @@ void Parser::parseAttribute(TempVector<AstAttr*>& attributes)
965973

966974
std::optional<AstAttr::Type> type = validateAttribute(nameLoc, attrName, attributes, args);
967975

968-
if (type)
969-
attributes.push_back(allocator.alloc<AstAttr>(Location(nameLoc, argsLocation), *type, args));
976+
if (FFlag::LuauAutocompleteAttributes)
977+
{
978+
attributes.push_back(
979+
allocator.alloc<AstAttr>(Location(nameLoc, argsLocation), type.value_or(AstAttr::Type::Unknown), args, AstName(attrName))
980+
);
981+
}
982+
else
983+
{
984+
if (type)
985+
attributes.push_back(allocator.alloc<AstAttr>(Location(nameLoc, argsLocation), *type, args));
986+
}
970987
}
971988
else
972989
{
973990
std::optional<AstAttr::Type> type = validateAttribute(nameLoc, attrName, attributes, empty);
974-
if (type)
975-
attributes.push_back(allocator.alloc<AstAttr>(nameLoc, *type, empty));
991+
if (FFlag::LuauAutocompleteAttributes)
992+
{
993+
attributes.push_back(allocator.alloc<AstAttr>(nameLoc, type.value_or(AstAttr::Type::Unknown), empty, AstName(attrName)));
994+
}
995+
else
996+
{
997+
if (type)
998+
attributes.push_back(allocator.alloc<AstAttr>(nameLoc, *type, empty));
999+
}
9761000
}
9771001

9781002
if (lexer.current().type == ',')
@@ -988,6 +1012,14 @@ void Parser::parseAttribute(TempVector<AstAttr*>& attributes)
9881012
else
9891013
{
9901014
report(Location(open.location, lexer.current().location), "Attribute list cannot be empty");
1015+
1016+
if (FFlag::LuauAutocompleteAttributes)
1017+
{
1018+
// autocomplete expects at least one unknown attribute.
1019+
attributes.push_back(
1020+
allocator.alloc<AstAttr>(Location(open.location, lexer.current().location), AstAttr::Type::Unknown, empty, nameError)
1021+
);
1022+
}
9911023
}
9921024

9931025
expectMatchAndConsume(']', open);

luau/CodeGen/include/Luau/AssemblyBuilderA64.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace A64
1919
enum FeaturesA64
2020
{
2121
Feature_JSCVT = 1 << 0,
22+
Feature_AdvSIMD = 1 << 1
2223
};
2324

2425
class AssemblyBuilderA64
@@ -139,6 +140,7 @@ class AssemblyBuilderA64
139140
void fsqrt(RegisterA64 dst, RegisterA64 src);
140141
void fsub(RegisterA64 dst, RegisterA64 src1, RegisterA64 src2);
141142
void faddp(RegisterA64 dst, RegisterA64 src);
143+
void fmla(RegisterA64 dst, RegisterA64 src1, RegisterA64 src2);
142144

143145
// Vector component manipulation
144146
void ins_4s(RegisterA64 dst, RegisterA64 src, uint8_t index);

luau/CodeGen/include/Luau/AssemblyBuilderX64.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ namespace CodeGen
1818
namespace X64
1919
{
2020

21+
enum FeaturesX64
22+
{
23+
Feature_FMA3 = 1 << 0,
24+
Feature_AVX = 1 << 1
25+
};
26+
2127
enum class RoundingModeX64
2228
{
2329
RoundToNearestEven = 0b00,
@@ -42,8 +48,8 @@ enum class ABIX64
4248
class AssemblyBuilderX64
4349
{
4450
public:
45-
explicit AssemblyBuilderX64(bool logText, ABIX64 abi);
46-
explicit AssemblyBuilderX64(bool logText);
51+
explicit AssemblyBuilderX64(bool logText, ABIX64 abi, unsigned int features = 0);
52+
explicit AssemblyBuilderX64(bool logText, unsigned int features = 0);
4753
~AssemblyBuilderX64();
4854

4955
// Base two operand instructions with 9 opcode selection
@@ -172,6 +178,8 @@ class AssemblyBuilderX64
172178
void vpinsrd(RegisterX64 dst, RegisterX64 src1, OperandX64 src2, uint8_t offset);
173179

174180
void vdpps(OperandX64 dst, OperandX64 src1, OperandX64 src2, uint8_t mask);
181+
void vfmadd213ps(OperandX64 dst, OperandX64 src1, OperandX64 src2);
182+
void vfmadd213pd(OperandX64 dst, OperandX64 src1, OperandX64 src2);
175183

176184
// Run final checks
177185
bool finalize();
@@ -216,6 +224,8 @@ class AssemblyBuilderX64
216224

217225
const ABIX64 abi;
218226

227+
const unsigned int features = 0;
228+
219229
private:
220230
// Instruction archetypes
221231
void placeBinary(

luau/CodeGen/include/Luau/IrData.h

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ enum class IrCmd : uint8_t
151151
DIV_NUM,
152152
IDIV_NUM,
153153
MOD_NUM,
154+
// A * B + C
155+
// A, B, C: double
156+
MULADD_NUM,
154157

155158
// Get the minimum/maximum of two numbers
156159
// If one of the values is NaN, 'B' is returned as the result
@@ -203,6 +206,9 @@ enum class IrCmd : uint8_t
203206
SUB_VEC,
204207
MUL_VEC,
205208
DIV_VEC,
209+
// Lanewise A * B + C
210+
// A, B, C: TValue
211+
MULADD_VEC,
206212

207213
// Negate a vector
208214
// A: TValue
@@ -227,6 +233,18 @@ enum class IrCmd : uint8_t
227233
// C: condition
228234
CMP_INT,
229235

236+
// Perform a comparison of two tags. Result is an integer register containing 0 or 1
237+
CMP_TAG,
238+
// A, B: tag
239+
// C: condition (eq/neq)
240+
241+
// Perform tag and value comparison. Result is an integer register containing 0 or 1
242+
CMP_SPLIT_TVALUE,
243+
// A: tag
244+
// B: tag (constant: boolean/string)
245+
// C, D: value
246+
// E: condition (eq/neq)
247+
230248
// Unconditional jump
231249
// A: block/vmexit/undef
232250
JUMP,
@@ -402,12 +420,6 @@ enum class IrCmd : uint8_t
402420
// C: Rn or unsigned int (key)
403421
SET_TABLE,
404422

405-
// TODO: remove with FFlagLuauCodeGenSimplifyImport2
406-
// Lookup a value in the environment
407-
// A: Rn (where to store the result)
408-
// B: unsigned int (import path)
409-
GET_IMPORT,
410-
411423
// Store an import from constant or the import path
412424
// A: Rn (where to store the result)
413425
// B: Kn
@@ -462,7 +474,7 @@ enum class IrCmd : uint8_t
462474
CHECK_NO_METATABLE,
463475

464476
// Guard against executing in unsafe environment, exits to VM on check failure
465-
// A: vmexit/vmexit/undef
477+
// A: block/vmexit/undef
466478
// When undef is specified, execution is aborted on check failure
467479
CHECK_SAFE_ENV,
468480

@@ -653,7 +665,7 @@ enum class IrCmd : uint8_t
653665
// C: Kn (prototype)
654666
FALLBACK_DUPCLOSURE,
655667

656-
// Prepare loop variables for a generic for loop, jump to the loop backedge unconditionally
668+
// Prepare loop variables for a generic for loop, jump to the loop back edge unconditionally
657669
// A: unsigned int (bytecode instruction index)
658670
// B: Rn (loop state start, updates Rn Rn+1 Rn+2)
659671
// C: block

luau/CodeGen/include/Luau/IrUtils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ inline bool hasResult(IrCmd cmd)
113113
case IrCmd::NOT_ANY:
114114
case IrCmd::CMP_ANY:
115115
case IrCmd::CMP_INT:
116+
case IrCmd::CMP_TAG:
117+
case IrCmd::CMP_SPLIT_TVALUE:
116118
case IrCmd::TABLE_LEN:
117119
case IrCmd::TABLE_SETNUM:
118120
case IrCmd::STRING_LEN:

0 commit comments

Comments
 (0)