Commit Graph

2973 Commits

Author SHA1 Message Date
Artem Kobzar 6d888e8e31 [K/JS] Fix stdlib long path problem on Windows for ES modules tests 2022-10-14 13:29:36 +00:00
Sergej Jaskiewicz d9681caf0c [JS IR] Generate 'names' entries for functions in sourcemaps 2022-10-14 10:09:40 +00:00
Artem Kobzar de880ce9aa [K/JS] Move ES modules logic to a new transformer with IC 2022-10-13 07:32:44 +00:00
Alexander Korepanov 7b2c125754 [JS IR] Update IC depends graph after intrinsics loading
- Remove unused params from compilerWithIC wrapper.
- Move JsIrBackendContext creation logic into separate function
- Introduce and use compiler interface for IC infrastructure

On dirty rebuild we may reload IR from stdlib,
such reloading may affect files with intrinsics and builtins.
As soon as we load only exported symbols, we must track dependencies
for files with intrinsics or builtins as for others.
This patch implements the logic which updates dependencies for
the stdlib files after loading of intrinsics and builtins.

^KT-54323 Fixed
2022-10-12 22:14:15 +00:00
Artem Kobzar 2081dc327c [K/JS] Trick-out the D8 bug related to a long path on Windows 2022-09-22 15:22:00 +00:00
Ilya Goncharov 4906f17d09 [JS IR] Fix js compiler arguments 2022-09-21 10:58:25 +00:00
Ilya Goncharov cab79d950f [Gradle, JS] outputName -> moduleName 2022-09-21 10:58:25 +00:00
Ilya Goncharov f320efedd3 [JS, Tests] Migrate IR tests onto outputDir and outputName 2022-09-21 10:58:21 +00:00
Ilya Goncharov eeb0520b48 [Gradle, JS] Migrate kotlin-stdlib-js 2022-09-21 10:58:21 +00:00
Ilya Goncharov d203dc35bf [JS IR] Add to IR keep possibility similar to legacy-dce one
It helps to:

- keep declarations even if they are not reachable and not exported
- not minify names of not exported declarations

Compiler argument: -Xir-keep=A,B

Can be used for top-level declarations or for member

^KT-54118 fixed
2022-09-20 16:06:17 +00:00
Alexander Korepanov 47bbd5e8c1 [JS IR] Add work around in EnumEntriesList for JS IR to avoid name clashes
JS IR generates bridges with type checks for special class methods,
 however if parent and child type parameters are same,
 the JS signature for the generated brige will be clashed with
 the JS signature of original method.

 This patch changes type parameter name of EnumEntriesList to avoid the clash.

^KT-54011 Fixed
2022-09-16 07:19:20 +00:00
Alexander Korepanov dd7d669464 [JS IR] Use jsOutputName for module naming when IC is enabled
^KT-53986 Fixed
2022-09-16 07:19:20 +00:00
Igor Yakovlev c2d4a2cfb5 [WASM] Small refactoring of box test runner 2022-09-15 16:27:40 +00:00
Dmitriy Dolovov e4556ecc0d [IR] User-friendly message about unexpected unlinked symbols
^KT-53649
2022-09-13 17:12:13 +00:00
Sergej Jaskiewicz b9cac8a4ca [JS IR] Support the sourceMapEmbedSources setting (partially)
This doesn't work with external libraries yet (including stdlib).
2022-09-09 11:02:25 +00:00
Alexander Korepanov 453faeaa45 [JS IR] Memory consumption optimization
- Remove IR after JS AST generation
 - Remove JS AST after/during JS code generation
2022-09-05 11:15:55 +00:00
Sergej Jaskiewicz 17f22c7204 [JS IR] Use a special executor for stepping tests
This will hopefully fix flakiness for some tests
2022-08-30 13:38:47 +00:00
Sergej Jaskiewicz d24bbb63f5 [JS IR] Enable logging for stepping tests
The IrJsSteppingTestGenerated.testTryCatchExpression test is flaky.
Let's enable some logging to see what's what.
2022-08-16 16:46:43 +00:00
Sergej Jaskiewicz 2ece4f4dbf [JS IR] Improve the precision of execution of stepping tests 2022-08-05 11:53:40 +00:00
Sergej Jaskiewicz 15bd101110 [JS IR] Fix sourcemap path mapping in compiler tests for Windows 2022-07-19 16:06:25 +00:00
Sergej Jaskiewicz ea556ce428 [JS IR] Implement stepping tests for Kotlin/JS
We already have stepping tests for Kotlin/JVM.
They are helpful for testing the correctness of the generated
debugging information.

They are better than line number tests in that they allow to test the
_behavior_, not the generated data. The structure of the data may change
even if the behavior stays the same. For that reason, stepping tests
are more stable.
2022-07-19 16:06:23 +00:00
Dmitriy Novozhilov c979e1edcf [Plugins] Deprecate ComponentRegistrar
^KT-52665 In Progress
2022-06-29 11:59:58 +00:00
Sergej Jaskiewicz 30b47b6902 [JS] Use absolute paths in sourcemaps for tests 2022-06-16 10:02:05 +00:00
Sergej Jaskiewicz 0320d49ddc [JS IR] Generate sourcemaps for JS IR tests 2022-06-16 10:02:04 +00:00
Alexander Korepanov 9e780afdca [JS IR] Rework incremental cache invalidation
Replace loading the whole world IR with loading only exported (reachable) IR.

 For that purpose the direct and inverse dependency graph is used.
 It is stored in a cache directory and the cache updater keeps it up to date.
 If after loading it is found that other files must be also implicitly rebuilt
 (see rebuilt reasons below), IR for that files also will be loaded.
 This algorithm repeats until the number of implicitly rebuilt files is not 0.

 More rebuilt reasons (dirty state) have been added:
  - added file: this is a new file;
  - modified ir: ir of the file has been updated;
  - updated exports: exports from the file have been added or removed
    (e.g. a function has been used from another file);
  - updated inline imports: imported inline function has been modified
    (transitively);
  - removed inverse depends: a dependent file has been removed;
  - removed direct depends: a dependency file has been removed;
  - removed file: this file has been removed.

 Incremental cache tests has been refactored:
  - The supporting of all rebuilt reasons (dirty states) has been added;
  - New file name format "*.$suffix.kt" for the test steps has been allowed,
    so the syntax highlight works now;
  - Explicit stdlib dependency usage has been removed.
2022-06-13 20:04:05 +00:00
Artem Kobzar e790607af5 feat(KT-51123): save comments from js-function call inside arguments list. 2022-06-13 12:58:18 +00:00
Igor Yakovlev 3abcd84802 [WASM] Fix Kotlin.Test box tests 2022-06-07 20:59:03 +00:00
Igor Yakovlev f996278171 [WASM] Support for mjs universal launcher 2022-06-07 20:59:03 +00:00
Nikolay Lunyak da8a8a8988 [FIR JS] Add a Fir2IrJsText runner 2022-06-02 13:47:30 +00:00
Nikolay Lunyak bdc3b5fe6f [FIR JS] Mute 170 failing multi-module tests 2022-06-02 13:47:24 +00:00
Nikolay Lunyak ccc72e5125 [FIR JS] Add a FirJsTest runner
Note: 763/1627 failed tests
- 170 are multi-module tests which can be ignored for now
2022-06-02 13:47:24 +00:00
Sergej Jaskiewicz e03747ea7d [JS IR] Introduce the GENERATE_INLINE_ANONYMOUS_FUNCTIONS feature flag 2022-06-01 09:02:31 +00:00
Artem Kobzar 8bc5508f5c fix(KT-52339): add newlines to SourceMap to calculate multiline comments in a right way. 2022-05-20 13:35:54 +00:00
Svyatoslav Kuzmich 84ed3ff5b0 [Wasm] Don't generate wat format by default in box tests
Gives ~15% tests speedup
Use kotlin.wasm.debugMode=1 to enable old behaviour
2022-05-20 13:34:28 +00:00
Svyatoslav Kuzmich d1c81eb6ba [Wasm] Support Wasm GC milestone 5 2022-05-20 12:22:43 +03:00
Ivan Kylchik f3252334b2 Move most of ir utils from backend.common to ir.tree 2022-05-18 21:20:03 +03:00
Svyatoslav Kuzmich 813b600555 [Wasm] Don't write .wat files in box tests
These files take space on CI, but they are not validated or processed
automatically in any way.

Disabled by default, enabled via kotlin.wasm.debugMode=1
2022-05-13 11:20:13 +00:00
Zalim Bashorov f8ef028da3 [Wasm] Remove no longer existed dirs from exclude list 2022-05-05 21:03:40 +00:00
Zalim Bashorov e594cad02a [Wasm] Add tests from "boxInline" 2022-05-05 21:03:38 +00:00
Zalim Bashorov db4888b3d4 [Wasm] Stop excluding a bunch of tests 2022-05-05 21:03:34 +00:00
Igor Laevsky 3de1235fda [WASM] Add command line option to enable/disable assertions 2022-04-26 20:41:52 +00:00
Artem Kobzar 7d7490eaa7 chore: fixe rest of comments tests. 2022-04-11 14:25:49 +00:00
Artem Kobzar f5e7b9886c fix: directive and line test. 2022-04-11 14:25:48 +00:00
Artem Kobzar e68ee4053e fix: add semicolon to pattern for parsing directive arguments. 2022-04-11 14:25:48 +00:00
Artem Kobzar 4e8082ad3a fix: arguments pattern for assertion directives. 2022-04-11 14:25:48 +00:00
Artem Kobzar 45e3c94a8b feat: add limited support of comments inside js call. 2022-04-11 14:25:46 +00:00
Artem Kobzar 7ef14fc11b chore: use CompositeBlock instead of GlobalBlock. 2022-04-11 10:37:14 +00:00
Igor Laevsky 81eae94821 [Wasm] Disable range checks for arrays. Add cli argument to enable them back. 2022-04-05 18:00:32 +00:00
Alexander Korepanov 9952d43252 [JS IR] IC improvements
- Reuse a built fragment
  - Use cache for saving built JS code
2022-04-04 17:42:04 +00:00
Sergej Jaskiewicz f7933dc9f4 [JS IR] Verify that we don't generate Unit_getInstance() statements
See: KT-51127
2022-03-31 09:46:51 +00:00