-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 2-component vector constructor (#1569)
Implement RFC: 2-component vector constructor. This includes 2-component overload for `vector.create` and associated fastcall function, and its type definition. These features are controlled by a new feature flag `LuauVector2Constructor`. Additionally constant folding now supports two components when `LuauVector2Constants` feature flag is set. Note: this work does not include changes to CodeGen. Thus calls to `vector.create` with only two arguments are not natively compiled currently. This is left for future work.
- Loading branch information
1 parent
24cacc9
commit 67e9d85
Showing
10 changed files
with
182 additions
and
30 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,14 @@ | ||
local function prequire(name) local success, result = pcall(require, name); return success and result end | ||
local bench = script and require(script.Parent.bench_support) or prequire("bench_support") or require("../bench_support") | ||
|
||
bench.runCode(function() | ||
for i=1,1000000 do | ||
vector.create(i, 2, 3) | ||
vector.create(i, 2, 3) | ||
vector.create(i, 2, 3) | ||
vector.create(i, 2, 3) | ||
vector.create(i, 2, 3) | ||
end | ||
end, "vector: create") | ||
|
||
-- TODO: add more tests |
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