Commit Graph

32 Commits

Author SHA1 Message Date
Arseny Kapoulkine 5b2e39c922
Sync to upstream/release/536 (#592) 2022-07-14 15:52:26 -07:00
Arseny Kapoulkine 2daa6497a1
Sync to upstream/release/534 (#569) 2022-06-30 16:52:43 -07:00
Arseny Kapoulkine 08ab7da4db
Sync to upstream/release/533 (#560) 2022-06-23 18:56:00 -07:00
Arseny Kapoulkine f1b46f4b96
Sync to upstream/release/532 (#545) 2022-06-16 18:05:14 -07:00
rblanckaert b066e4c8f8
0.531 (#532)
* Fix free Luau type being fully overwritten by 'any' and causing UAF
* Fix lua_clonefunction implementation replacing top instead of pushing
* Falsey values other than false can now narrow refinements
* Fix lua_getmetatable, lua_getfenv not waking thread up
* FIx a case where lua_objlen could push a new string without thread wakeup or GC
* Moved Luau math and bit32 definitions to definition file 
* Improve Luau parse recovery of incorrect return type token
2022-06-10 09:58:21 -07:00
rblanckaert 61766a692c
Sync to upstream/release/529 (#505)
* Adds a currently unused x86-64 assembler as a prerequisite for possible future JIT compilation
* Fix a bug in table iteration (closes Possible table iteration bug #504)
* Improved warning method when function is used as a type
* Fix a bug with unsandboxed iteration with pairs()
* Type of coroutine.status() is now a union of value types
* Bytecode output for tests/debugging now has labels
* Improvements to loop unrolling cost estimation
* Report errors when the key obviously doesn't exist in the table
2022-05-26 15:08:16 -07:00
Arseny Kapoulkine f5923aefeb
Sync to upstream/release/527 (#491) 2022-05-19 17:02:24 -07:00
Arseny Kapoulkine a36b1eb29b
Sync to upstream/release/527 (#481) 2022-05-13 12:36:37 -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 e0a6461173
Sync to upstream/release/524 (#462) 2022-04-21 14:44:27 -07:00
Arseny Kapoulkine 8e7845076b
Sync to upstream/release/523 (#459) 2022-04-14 16:57:43 -07:00
Arseny Kapoulkine de1381e3f1
Sync to upstream/release/522 (#450) 2022-04-07 14:29:01 -07:00
Arseny Kapoulkine 4c1f208d7a
Sync to upstream/release/521 (#443) 2022-03-31 14:01:51 -07:00
Arseny Kapoulkine 362428f8b4
Sync to upstream/release/519 (#422) 2022-03-17 17:46:04 -07:00
Arseny Kapoulkine 63d5423bbb
Sync to upstream/release/514 (#357) 2022-02-11 11:02:09 -08:00
Arseny Kapoulkine d58e70b8c1
Sync to upstream/release/513 (#340) 2022-02-04 08:45:57 -08:00
Arseny Kapoulkine 2f989fc049
Sync to upstream/release/512 (#330)
- Improve refinement support for unions, in particular it's now possible to implement tagged unions as a union of tables where individual branches use a string literal type for one of the fields.
- Fix `string.split` type information
- Optimize `select(_, ...)` to run in constant time (~2.7x faster on VariadicSelect benchmark)
- Improve debug line information for multi-line assignments
- Improve compilation of table literals when table keys are constant expressions/variables
- Use forward GC barrier for `setmetatable` which slightly accelerates GC progress
2022-01-27 15:46:05 -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 32c39e2162
Sync to upstream/release/510 (#313) 2022-01-14 08:20:09 -08:00
rafa_br34 b7f78f4997
MSVC warning C4244 fixes (#308)
Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
2022-01-12 10:05:31 -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
Arseny Kapoulkine f2e6a8f4a5
Sync to upstream/release/507-pre (#286)
This doesn't contain all changes for 507 yet but we might want to do the
Luau 0.507 release a bit earlier to end the year sooner.

Changes:

- Type ascription (::) now permits casts between related types in both directions, allowing to refine or loosen the type (RFC #56)
- Fix type definition for tonumber to return number? since the input string isn't guaranteed to contain a valid number
- Fix type refinements for field access via []
- Many stability fixes for type checker
- Provide extra information in error messages for type mismatches in more cases
- Improve performance of type checking for large unions when union members are string literals
- Add coverage reporting support to Repl (--coverage command line argument) and lua_getcoverage C API
- Work around code signing issues during Makefile builds on macOS
- Improve performance of truthiness checks in some cases, particularly on Apple M1, resulting in 10-25% perf gains on qsort benchmark depending on the CPU/compiler
- Fix support for little-endian systems; IBM s390x here we go!
2021-12-10 14:05:05 -08:00
Arseny Kapoulkine 32fb6d10a7
Sync to upstream/release/506 (#270)
- Fix some cases where type checking would overflow the native stack
- Improve autocomplete behavior when assigning a partially written function call (not currently exposed through command line tools)
- Improve autocomplete type inference feedback for some expressions where previously the type would not be known
- Improve quantification performance during type checking for large types
- Improve type checking for table literals when the expected type of the table is known because of a type annotation
- Fix type checking errors in cases where required module has errors in the resulting type
- Fix debug line information for multi-line chained call sequences (Add function name information for "attempt to call a nil value" #255)
- lua_newuserdata now takes 2 arguments to match Lua/LuaJIT APIs better; lua_newuserdatatagged should be used if the third argument was non-0.
- lua_ref can no longer be used with LUA_REGISTRYINDEX to prevent mistakes when migrating Lua FFI (Inconsistency with lua_ref #247)
- Fix assertions and possible crashes when executing script code indirectly via metatable dispatch from lua_equal/lua_lessthan/lua_getfield/etc. (Hitting a crash in an assert after lua_equal is called. #259)
- Fix flamegraph scripts to run under Python 2
2021-12-02 22:41:04 -08:00
Arseny Kapoulkine 3f1508c83a
Sync to upstream/release/505 (#216)
- Improve error recovery during type checking
- Initial (not fully complete) implementation for singleton types (RFC RFC: Singleton types #37)
- Implement a C-friendly interface for compiler (luacode.h)
- Remove C++ features from lua.h (removed default arguments from luau_load and lua_pushcfunction)
- Fix lua_breakpoint behavior when enabled=false
- Implement coroutine.close (RFC RFC: coroutine.close #88)

Note, this introduces small breaking changes in lua.h:

- luau_load env argument is now required, pass an extra 0
- lua_pushcfunction now must be called with 3 arguments; if you were calling it with 2 arguments, pass an extra NULL; if you were calling it with 4, use lua_pushcclosure.

These changes are necessary to make sure lua.h can be used from pure C - the future release will make it possible by adding an option to luaconf.h to change function name mangling to be C-compatible. We don't anticipate breaking the FFI interface in the future, but this change was necessary to restore C compatibility.

Closes #121
Fixes #213
2021-11-19 08:10:07 -08:00
Arseny Kapoulkine d47b2f1dfe
Sync to upstream/release/504 (#200)
- Type mismatch errors now show detailed information for compound types, highlighting the mismatching component
- Fix string.pack bug on ARM when packing negative numbers using unsigned formats
- Implement bit32.countlz/countrz (RFC RFC: bit32.countlz/countrz #89)
- Minor compiler throughput optimization (~2% faster compilation)
- Improve transpiler behavior for edge cases and better test coverage (not exposed through CLI at the moment)
- Improve error recovery when parsing invalid assignments
- Build fixes for fuzzing targets
2021-11-12 06:27:34 -08:00
LoganDark 9523670e63
Remove Roblox-specific mutable globals (#185)
Instead the code that calls the compiler needs to use Compiler::mutableGlobals to disable GETIMPORT optimization.
2021-11-09 07:06:25 -08:00
Rerumu 6342913533
Fix small assert ordering (#143) 2021-11-05 14:38:08 -07:00
bmcq-0 ad9b47b72f
Fold length operations when argument is a constant string (#141)
Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
2021-11-05 13:24:30 -07:00
Arseny Kapoulkine 49b0c59eec
Sync to upstream/release/502 (#134)
Changes:
- Support for time tracing for analysis/compiler (not currently exposed
  through CLI)
- Support for type pack arguments in type aliases (#83)
- Basic support for require(path) in luau-analyze
- Add a lint warning for table.move with 0 index as part of
  TableOperation lint
- Remove last STL dependency from Luau.VM
- Minor VS2022 performance tuning

Co-authored-by: Rodactor <rodactor@roblox.com>
2021-11-04 19:34:35 -07:00
Josh Soref 278e848cc2
Spelling (#119)
Fixed various spelling errors.

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-11-04 09:50:46 -05: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