-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed garbage data in module scopes when type graph is not retained * LOP_MOVE with the same source and target registers is no longer generated (Fixes #793)
- Loading branch information
1 parent
685ca02
commit be52bd9
Showing
45 changed files
with
2,679 additions
and
378 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ struct RecursionCounter | |
--(*count); | ||
} | ||
|
||
private: | ||
protected: | ||
int* count; | ||
}; | ||
|
||
|
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,40 @@ | ||
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details | ||
#pragma once | ||
|
||
#include "Luau/Type.h" | ||
#include "Luau/TypeArena.h" | ||
#include "Luau/TypePack.h" | ||
#include "Luau/Variant.h" | ||
|
||
namespace Luau | ||
{ | ||
|
||
/// If it's desirable to allocate into a different arena than the TypeReduction instance you have, you will need | ||
/// to create a temporary TypeReduction in that case. This is because TypeReduction caches the reduced type. | ||
struct TypeReduction | ||
{ | ||
explicit TypeReduction(NotNull<TypeArena> arena, NotNull<BuiltinTypes> builtinTypes, NotNull<InternalErrorReporter> handle); | ||
|
||
std::optional<TypeId> reduce(TypeId ty); | ||
std::optional<TypePackId> reduce(TypePackId tp); | ||
std::optional<TypeFun> reduce(const TypeFun& fun); | ||
|
||
private: | ||
NotNull<TypeArena> arena; | ||
NotNull<BuiltinTypes> builtinTypes; | ||
NotNull<struct InternalErrorReporter> handle; | ||
|
||
DenseHashMap<TypeId, TypeId> cachedTypes{nullptr}; | ||
DenseHashMap<TypePackId, TypePackId> cachedTypePacks{nullptr}; | ||
|
||
std::optional<TypeId> reduceImpl(TypeId ty); | ||
std::optional<TypePackId> reduceImpl(TypePackId tp); | ||
|
||
// Computes an *estimated length* of the cartesian product of the given type. | ||
size_t cartesianProductSize(TypeId ty) const; | ||
|
||
bool hasExceededCartesianProductLimit(TypeId ty) const; | ||
bool hasExceededCartesianProductLimit(TypePackId tp) const; | ||
}; | ||
|
||
} // 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.