Commit Graph

132 Commits

Author SHA1 Message Date
Mikhail Glukhikh 08ba89b4ec CLI K2: report an error for JS/Native/Metadata #KT-52035 Fixed 2022-04-28 13:25:48 +00:00
Igor Laevsky 3de1235fda [WASM] Add command line option to enable/disable assertions 2022-04-26 20:41:52 +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
Ilya Goncharov c67c1a69b9 rra/ilgonmic/reducing-size
[JS IR] Fix review remarks

- Fix translation mode from flags calculation
- comment why not top level could be safely inlined

[JS IR] Add test on exportness of internal val

Revert "[Gradle, JS] Disable minimizing names in production by default"

This reverts commit 700ff8634a73f155a2f0eaf963778216d6877075.

[JS IR] Adopt reserved names

Revert "[JS IR] Reserve interop names"

This reverts commit 63f30becaf1a45750ff85aea3753aae9a85985f4.

Revert "[JS IR] Clear minimized namer states"

This reverts commit ef7f19fa8a928021e8bdfbee7fbb5285fc74b7ab.

[JS IR] Clear minimized namer states

[JS IR] Reserve interop names

[JS IR] Separate arguments for users

[JS IR] Minimized member names in tests

[Gradle, JS] Disable minimizing names in production by default

[JS IR] Fix extra helps

[JS IR] Move mangling of signatures to linking namer

[JS IR] Add key and minimized name generator

[JS IR] cross module dependencies minimized

[JS IR] Minimize names

[JS IR] Cross module by index

[JS IR] Fix warning

[JS IR] Fix inlining accessors

[JS IR] Bridges for property accessors

[JS IR] Special case of jsFunctionSignature with property accessors

[JS IR] Inline property accessor for non top level properties

[JS IR] Reduce crossModule size

Merge-request: KT-MR-5785
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51735 fixed
^KT-50504 fixed
2022-03-28 10:39:15 +00:00
Alexander Korepanov 69295f2cf0 [JS IR] IC invalidation refactoring
- Huge refactoring for IC
  - Update hash combination logic
  - Introduce value class for IC hashes
  - Calc md5 directly by function IR
  - Split IC logic by classes
  - Move JsIrLinkerLoader into separate file
  - CacheUpdateStatus is a sealed class
  - Render TYPE_PARAMETER reified flag

^KT-51081 Fixed
^KT-51084 Fixed
2022-03-15 05:34:19 +00:00
Alexander Korepanov 43a0876c26 [JS IR] IC invalidation performance improvements
- Cache signature readers and deserializers
 - Cache inline function hashes
 - IC refactoring
 - [gradle] Use hash of module path for cache dir; Fix KT-51238

^KT-51238 Fixed
2022-02-16 13:41:53 +00:00
Svyatoslav Kuzmich 4636f71076 [Wasm] Loader improvements
- Output ES modules instead of plain files
- Support -Xwasm-launcher=d8 for d8 shell used in tests and benchmarks.
- Reuse launcher generation logic in CLI and box tests runners.
- Create separate output directory for each box since
  there are multiple output files generated for each test.
- Stop using absolute paths in generate JS files
  to simplify running generated code on different machine
- Remove ">>>" from println output


Merge-request: KT-MR-5729
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2022-02-10 22:59:44 +00:00
Ilya Goncharov 77b367fe96 rra/ilgonmic/ic-to-compiler
[JS IR] Fix compilation in tests

[JS IR] Fix test after migrating IC to compiler

[JS IR] Fix memory leak

[JS IR] Move js ic to compiler

Merge-request: KT-MR-5673
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
2022-02-07 11:40:16 +00:00
Ilya Goncharov a2167200d6 [JS IR] IR module to name
Merge-request: KT-MR-5672
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
2022-02-03 17:28:46 +00:00
Igor Laevsky 4e84e14d34 [Wasm] Don't squish modules together 2022-02-03 18:19:30 +03:00
Igor Yakovlev 1446914ba9 [WASM] Run box tests with dce and non-dce modes 2022-02-02 16:44:47 +03:00
Igor Yakovlev 2ec0411a7f [WASM] DCE implementation 2022-01-26 23:40:41 +03:00
Dmitriy Novozhilov dd953908df [FE 1.0] Add compiler flag for rendering internal diagnostic names in error messages 2022-01-23 11:14:56 +03:00
Alexander Korepanov 59173baf5a [JS IR] Pass forward -Xir-property-lazy-initialization option
Pass forward -Xir-property-lazy-initialization option
for the incremental cache.

^KT-50175 Fixed
2022-01-19 13:28:47 +00:00
Andrey Uskov 2adc851f1b Don't use global state for keeping incremental compilation state
Previously IC state was stored in System properties. As result parallel
compilation might cause incorrect state of IC, what led to corruption
of kotlin_module files. Now IC state is stored via CompilerArguments
and CompilerConfiguration
#KT-46038 Fixed
2022-01-12 13:37:46 +03:00
Igor Yakovlev 82455c849d [WASM] Lazy properties initialization 2022-01-05 13:12:32 +01:00
Roman Artemev 353bfe9018 [JS IR] Cleanup pir IC code 2021-12-24 16:50:40 +03:00
Anton Bannykh 4c33cb8016 [JS IR] IC: support per-module in K2JsIrCompiler 2021-12-22 10:14:33 +03:00
Anton Bannykh ca60caa7e9 [JS IR] IC: pass through the main args 2021-12-22 10:14:32 +03:00
Anton Bannykh aa628ae7b3 [JS IR] tests both per-module and regular mode 2021-12-22 10:14:08 +03:00
Anton Bannykh 95b5c44fba [JS IR] IC: emit source maps 2021-12-22 10:13:07 +03:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Roman Artemev 893582fa65 [JS IR] Setup config about path relativeness and normalization in config 2021-12-15 21:13:51 +03:00
Ilya Goncharov db9640c3b3 [Gradle, JS] Add gradle property for per-module/whole-program
Merge-request: KT-MR-5200
2021-12-15 09:08:45 +00:00
Roman Artemev b719865c25 [JS IR IC] Implement fast path invalidation check
Compute library md5 hash and check it first with cached one. If hashes
are equal it means that cache is up-to-date and no additional checks are
needed

 - store library hashes (flat + trans) into cache info file
 - change invalidator return value
2021-12-13 20:57:52 +03:00
Anton Bannykh 8c558fb6ba [JS IR] fix compilation 2021-12-05 15:38:04 +03:00
Anton Bannykh 53fe540884 [JS IR] use correct factory for new IR2JS 2021-12-05 15:38:04 +03:00
Anton Bannykh 038514ed65 [JS IR] fix IC (KT-49878 fixed) 2021-12-05 15:38:04 +03:00
Artem Kobzar 08b0e17d47 feat(polyfills): use stdlib for js polyfills. 2021-11-26 08:14:34 +00:00
Ilya Goncharov 98bedf7eed [IR] More user-friendly compilation exceptions from lowerings and JS codegen
Merge-request: KT-MR-5004
2021-11-25 13:21:34 +00:00
Roman Artemev a01d9b77c3 [JS IR] Delegate invalidated files processing to the caller
This change is needed to test invalidation somehow
2021-11-25 11:22:45 +03:00
Roman Artemev 7d8f71d107 [JS IR] Add CLI flag and configuration key about partial linkage
- make possible to turn on/off linkage if klib contains unbound symbols
 - update jsExtraHelp test data
2021-11-19 01:16:32 +03:00
Anton Bannykh 75368a2c06 [JS IR] tie together IC code in tests and K2JsIrCompiler 2021-11-19 00:39:37 +03:00
Anton Bannykh 1ae042edc3 [JS IR] make old Ir2Js pass all tests 2021-11-19 00:38:46 +03:00
Anton Bannykh d565cc4262 [JS IR] support new Ir2Js in tests and in K2JsTranslator 2021-11-19 00:38:42 +03:00
Artem Kobzar 7aa8de55a5 fix(use strict): move global this polyfill after "use strict" pragma. 2021-11-12 15:59:27 +00:00
Igor Laevsky 43eeaa925f [Wasm] Add ability to choose flavor for the wasm launcher 2021-11-03 16:23:01 +03:00
Anton Bannykh 546ce501cb [JS IR] run IC box tests 2021-10-15 20:14:51 +03:00
Svyatoslav Kuzmich 0f66f85cf9 [Wasm] Support main function 2021-10-15 13:58:55 +03:00
Igor Laevsky bede039c08 [Wasm] Add compiler support for the kotlin.test library 2021-10-14 17:24:05 +03:00
Svyatoslav Kuzmich 3f8dce4b53 [JS IR] Support per-file mode and ES modules 2021-10-12 23:29:39 +03:00
Svyatoslav Kuzmich 841f5a583e [Wasm] Support wasm target in multiplatform plugin 2021-09-28 18:26:07 +03:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Ilya Goncharov 064744fae7 [JS IR] Remove redundant legacy property access property 2021-09-24 07:07:12 +00:00
Igor Yakovlev b8d11f7938 [WASM] Add text section to implement debug info 2021-09-20 19:08:21 +03:00
Svyatoslav Kuzmich 7e399202a2 [Wasm] Support generating browser-compatible JS harness
* Use fetch and instantiateStreaming
* Call main export if it is present
* Produce a variable with module name that contains a
  promise of module exports
2021-09-16 14:14:58 +03:00
Roman Artemev a2e4ebd820 [JS IC] Support //RECOMPILE directive in js box tests
- change test runner to production mode when sources are being compiled
 into klib and then klib is being translated into js, not directly from
 kt to js
 - fix IC cache format
 - support IC tests
2021-09-13 13:44:55 +03:00
Stanislav Erokhin 9becb2c468 Add compiler performance metrics
WIP
2021-08-24 16:33:12 +03:00