-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync to upstream/release/614 (#1173)
# What's changed? Add program argument passing to scripts run using the Luau REPL! You can now pass `--program-args` (or shorthand `-a`) to the REPL which will treat all remaining arguments as arguments to pass to executed scripts. These values can be accessed through variadic argument expansion. You can read these values like so: ``` local args = {...} -- gets you an array of all the arguments ``` For example if we run the following script like `luau test.lua -a test1 test2 test3`: ``` -- test.lua print(...) ``` you should get the output: ``` test1 test2 test3 ``` ### Native Code Generation * Improve A64 lowering for vector operations by using vector instructions * Fix lowering issue in IR value location tracking! - A developer reported a divergence between code run in the VM and Native Code Generation which we have now fixed ### New Type Solver * Apply substitution to type families, and emit new constraints to reduce those further * More progress on reducing comparison (`lt/le`)type families * Resolve two major sources of cyclic types in the new solver ### Miscellaneous * Turned internal compiler errors (ICE's) into warnings and errors ------- Co-authored-by: Aaron Weiss <[email protected]> Co-authored-by: Alexander McCord <[email protected]> Co-authored-by: Andy Friesen <[email protected]> Co-authored-by: Aviral Goel <[email protected]> Co-authored-by: Vyacheslav Egorov <[email protected]> --------- Co-authored-by: Aaron Weiss <[email protected]> Co-authored-by: Alexander McCord <[email protected]> Co-authored-by: Andy Friesen <[email protected]> Co-authored-by: Aviral Goel <[email protected]> Co-authored-by: David Cope <[email protected]> Co-authored-by: Lily Brown <[email protected]> Co-authored-by: Vyacheslav Egorov <[email protected]>
- Loading branch information
1 parent
80928ac
commit 3b0e93b
Showing
62 changed files
with
1,826 additions
and
716 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details | ||
#pragma once | ||
|
||
#include "Luau/NotNull.h" | ||
#include "Luau/Substitution.h" | ||
#include "Luau/TxnLog.h" | ||
#include "Luau/TypeFwd.h" | ||
#include "Luau/Unifiable.h" | ||
|
||
namespace Luau | ||
{ | ||
|
||
struct TypeArena; | ||
struct TypeCheckLimits; | ||
|
||
struct Replacer : Substitution | ||
{ | ||
DenseHashMap<TypeId, TypeId> replacements; | ||
DenseHashMap<TypePackId, TypePackId> replacementPacks; | ||
|
||
Replacer(NotNull<TypeArena> arena, DenseHashMap<TypeId, TypeId> replacements, DenseHashMap<TypePackId, TypePackId> replacementPacks) | ||
: Substitution(TxnLog::empty(), arena) | ||
, replacements(std::move(replacements)) | ||
, replacementPacks(std::move(replacementPacks)) | ||
{ | ||
} | ||
|
||
bool isDirty(TypeId ty) override | ||
{ | ||
return replacements.find(ty) != nullptr; | ||
} | ||
|
||
bool isDirty(TypePackId tp) override | ||
{ | ||
return replacementPacks.find(tp) != nullptr; | ||
} | ||
|
||
TypeId clean(TypeId ty) override | ||
{ | ||
return replacements[ty]; | ||
} | ||
|
||
TypePackId clean(TypePackId tp) override | ||
{ | ||
return replacementPacks[tp]; | ||
} | ||
}; | ||
|
||
// A substitution which replaces generic functions by monomorphic functions | ||
struct Instantiation2 : Substitution | ||
{ | ||
// Mapping from generic types to free types to be used in instantiation. | ||
DenseHashMap<TypeId, TypeId> genericSubstitutions{nullptr}; | ||
// Mapping from generic type packs to `TypePack`s of free types to be used in instantiation. | ||
DenseHashMap<TypePackId, TypePackId> genericPackSubstitutions{nullptr}; | ||
|
||
Instantiation2(TypeArena* arena, DenseHashMap<TypeId, TypeId> genericSubstitutions, DenseHashMap<TypePackId, TypePackId> genericPackSubstitutions) | ||
: Substitution(TxnLog::empty(), arena) | ||
, genericSubstitutions(std::move(genericSubstitutions)) | ||
, genericPackSubstitutions(std::move(genericPackSubstitutions)) | ||
{ | ||
} | ||
|
||
bool isDirty(TypeId ty) override; | ||
bool isDirty(TypePackId tp) override; | ||
TypeId clean(TypeId ty) override; | ||
TypePackId clean(TypePackId tp) override; | ||
}; | ||
|
||
} // namespace Luau |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.