Commit Graph

19 Commits

Author SHA1 Message Date
vegorov-rbx d141a5c48d
Sync to upstream/release/572 (#899)
* Fixed exported types not being suggested in autocomplete
* `T...` is now convertible to `...any` (Fixes
https://github.com/Roblox/luau/issues/767)
* Fixed issue with `T?` not being convertible to `T | T` or `T?`
(sometimes when internal pointer identity is different)
* Fixed potential crash in missing table key error suggestion to use a
similar existing key
* `lua_topointer` now returns a pointer for strings

C++ API Changes:
* `prepareModuleScope` callback has moved from TypeChecker to Frontend
* For LSPs, AstQuery functions (and `isWithinComment`) can be used
without full Frontend data

A lot of changes in our two experimental components as well.

In our work on the new type-solver, the following issues were fixed:
* Fixed table union and intersection indexing
* Correct custom type environments are now used
* Fixed issue with values of `free & number` type not accepted in
numeric operations

And these are the changes in native code generation (JIT):
* arm64 lowering is almost complete with support for 99% of IR commands
and all fastcalls
* Fixed x64 assembly encoding for extended byte registers
* More external x64 calls are aware of register allocator
* `math.min`/`math.max` with more than 2 arguments are now lowered to IR
as well
* Fixed correctness issues with `math` library calls with multiple
results in variadic context and with x64 register conflicts
* x64 register allocator learnt to restore values from VM memory instead
of always using stack spills
* x64 exception unwind information now supports multiple functions and
fixes function start offset in Dwarf2 info
2023-04-14 11:06:22 -07:00
vegorov-rbx 42a2805f85
Sync to upstream/release/568 (#865)
* A small subset of control-flow refinements have been added to
recognize type options that are unreachable after a
conditional/unconditional code block. (Fixes
https://github.com/Roblox/luau/issues/356).

Some examples:
```lua
local function f(x: string?)
    if not x then return end

    -- x is 'string' here
end
```
Throwing calls like `error` or `assert(false)` instead of 'return' are
also recognized.
Existing complex refinements like type/typeof and tagged union checks
are expected to work, among others.

To enable this feature, `LuauTinyControlFlowAnalysis` exclusion has to
be removed from `ExperimentalFlags.h`.
If will become enabled unconditionally in the near future.

* Linter has been integrated into the typechecker analysis so that
type-aware lint warnings can work in any mode
`Frontend::lint` methods were deprecated, `Frontend::check` has to be
used instead with `runLintChecks` option set.
Resulting lint warning are located inside `CheckResult`.

* Fixed large performance drop and increased memory consumption when
array is filled at an offset (Fixes
https://github.com/Roblox/luau/issues/590)
* Part of [Type error suppression
RFC](https://github.com/Roblox/luau/blob/master/rfcs/type-error-suppression.md)
was implemented making subtyping checks with `any` type transitive.

---
In our work on the new type-solver:
* `--!nocheck` mode no longer reports type errors
* New solver will not be used for `--!nonstrict` modules until all
issues with strict mode typechecking are fixed
* Added control-flow aware type refinements mentioned earlier

In native code generation:
* `LOP_NAMECALL` has been translated to IR
* `type` and `typeof` builtin fastcalls have been translated to
IR/assembly
* Additional steps were taken towards arm64 support
2023-03-17 12:20:37 -07:00
Arseny Kapoulkine 1b20fcd43c
Sync to upstream/release/539 (#625) 2022-08-04 15:35:33 -07:00
Arseny Kapoulkine d3b566c258
Sync to upstream/release/538 (#616) 2022-07-28 21:24:07 -07:00
Arseny Kapoulkine 506d971421
Sync to upstream/release/535 (#584) 2022-07-07 18:22:39 -07:00
Arseny Kapoulkine f1b46f4b96
Sync to upstream/release/532 (#545) 2022-06-16 18:05:14 -07:00
Arseny Kapoulkine e9cc76a3d5
Sync to upstream/release/526 (#477) 2022-05-05 17:03:43 -07:00
Arseny Kapoulkine bd6d44f5e3
Sync to upstream/release/525 (#467) 2022-04-28 18:24:24 -07:00
Arseny Kapoulkine 8e7845076b
Sync to upstream/release/523 (#459) 2022-04-14 16:57:43 -07:00
Arseny Kapoulkine 4c1f208d7a
Sync to upstream/release/521 (#443) 2022-03-31 14:01:51 -07:00
Arseny Kapoulkine 2c339d52c0
Sync to upstream/release/520 (#427) 2022-03-24 15:04:14 -07:00
Arseny Kapoulkine 362428f8b4
Sync to upstream/release/519 (#422) 2022-03-17 17:46:04 -07:00
Arseny Kapoulkine dbdf91f3ca
Sync to upstream/release/517 (#408) 2022-03-04 08:36:33 -08:00
Arseny Kapoulkine c7eca27909
Sync to upstream/release/516 (#397) 2022-02-24 15:53:37 -08:00
Arseny Kapoulkine 8fe95c9963
Sync to upstream/release/511 (#324)
- TableOperations lint now includes a warning for table.create(N, {}) (which is likely a mistake since the table is shared by all entries)
- Type checker now type checks #v when v is a union
- Parser now rejects sources that consists of a single unfinished long comment
- Work around significant MSVC 2022 performance regression, bringing it more or less in line with MSVC 2019
- Compiler now predicts array size for newly allocated tables when the table is filled in a short loop
- Small improvements in compilation throughput (~2% faster)
- Implement paged sweeper for GC which improves sweep throughput 2-3x and reduces memory consumption by 8 bytes per object (once it is stabilized we will see additional 8 bytes per object of savings)
- Improve Repl Tab completion
- Repl now supports -i (interactive mode to run code in context of a script's environment) and -On (to control optimization flags)
2022-01-21 09:00:19 -08:00
Arseny Kapoulkine d50b079325
Sync to upstream/release/509 (#303)
- Rework transaction log used for type checking which should result in more robust type checking internals with fewer bugs
- Reduce the amount of memory consumed by type checker on large module graphs
- Type checker now errors on attempts to change the type of imported module fields
- The return type of newproxy is now any (fixes #296)
- Implement new number printing algorithm (Schubfach) which makes tostring() produce precise (round-trippable) and short decimal output up to 10x faster
- Fix lua_Debug::linedefined to point to the line with the function definition instead of the first statement (fixes #265)
- Fix minor bugs in Tab completion in Repl
- Repl now saves/restores command history in ~/.luau_history
2022-01-06 17:46:53 -08:00
petrihakkinen 2740f69f32
Expand vectors to 4 components using compile time switch (#214)
Co-authored-by: Petri Häkkinen <petrih@rmd.remedy.fi>
Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
2021-11-22 07:42:33 -08:00
LoganDark d6b3346f58
move static_assert from ltable.h to ltable.cpp (#189) 2021-11-09 17:02:46 -08:00
Arseny Kapoulkine d01addc625 Sync to upstream/release/501 (#20)
Co-authored-by: Rodactor <rodactor@roblox.com>
2021-11-01 14:52:34 -07:00