Commit Graph

55 Commits

Author SHA1 Message Date
Alexander Udalov ca5a35b4b3 Move CompilerEnvironment from 'frontend' to 'cli'
This is needed in order to have a single convenient place where to
register frontend services implemented _outside_ of the 'frontend'
module, such as the control flow analysis, extracted to a separate
module in a subsequent commit.
2021-02-24 17:17:03 +01:00
Ilya Goncharov bd2601f289 [JS IR] Extract adding of function call to another function
[JS IR] Add option for dce mode

[JS IR] Add logging to non useful declarations if appropriate dce mode

[JS IR] Add mode with throwing exception

[JS IR] unreachableDeclaration method is in rootDeclarations

[JS IR] Add js extra help arg with dce mode and include debug.kt to compile unreachableMethod

[JS IR] unreachableDeclaration as internal to not reproduce stdlib api

[JS IR] Fix description of dce mode argument

- Use console.error instead of console.log
- Use JsError instead Kotlin exception for lightweight

[JS IR] Remove body for throwing exception

[JS IR] Remove default parameter in unreachableDeclaration

[JS IR] Process without removing fields and declaration containers

[JS IR] Rename dce mode on dce runtime diagnostic

[JS IR] Use console.trace instead of console.error

[JS IR] Extract JsError

- Fix naming in prependFunctionCall
- Fix description on runtime diagnostic argument
- Using message collector instead of throwing exception

[JS IR] Distinguish unreachableMethods for log and exception

[JS IR] Extract checking of Kotlin packages of IrField

^KT-45059 fixed
2021-02-20 12:05:06 +03:00
Anton Bannykh c06b345f3c Hide stageController into the IrFactory 2021-02-17 10:42:50 +03:00
Anton Bannykh f42f2fa743 JS DCE: disable logging by default
Based on Vladislav Saifulin's PR #4031
2021-02-02 18:38:50 +03:00
Anton Bannykh bbc6d2b993 JS DCE: use less LinkedHashSets 2021-02-02 18:38:49 +03:00
Roman Artemev 24d82c63e0 [JS IR] Commonize CLI error reporting
Use general `AnalysisResult.CompilationErrorException` instead of
custom JsIrCompilationError to indicate about unsuccessful compilation

- Drop JsIrCompilationError
2021-02-02 12:05:34 +03:00
Roman Artemev 37c7f60ae7 [KLIB] Fix issues between directory and .klib modes
- use .klib extension explicitly
 - fix issue with `module.klib.klib` names
2021-01-26 19:23:23 +03:00
Roman Artemev 2daf0cc11c [JS IR] Support additional repositories in CLI (cli part) 2021-01-26 19:23:22 +03:00
Roman Artemev cd9e341fa9 [JS IR] Support additional repositories in CLI (compiler part) 2021-01-26 19:23:22 +03:00
Ilya Goncharov efee3ea648 [JS IR] - Remove file lowering declarations from lowering phases
- rename fileToPurenessInitializers onto fileToInitializerPureness
- remove redundant check on top-level property

[JS IR] Rename initialis* to initializ* for consistency

[JS IR] Move propertyLazyInitialization property to context from configuration

[JS IR] Add test on lazy initialization properties order

[JS IR] Add multi module for lazy initialization of properties

[JS IR] Move tests onto js.translator

[JS IR] Rename fileToInitializerPureness according to context name

^KT-43222 fixed
2020-11-24 12:33:44 +03:00
Ilya Goncharov a2d41b86bf [JS IR] Add compiler argument about lazy initialisation
^KT-43222 fixed
2020-11-24 12:33:43 +03:00
Alexander Gorshenev f42b902bc8 Made -Xfake-override-validator off by default
Deprected -Xdisable-fake-override-validator
2020-11-18 12:46:40 +03:00
Svyatoslav Kuzmich e51a76bc4e [Wasm] Basic CLI
-Xwasm option that will produce wasm instead of JS when used with -Xir-produce-js
Does not affect klib production
2020-11-10 13:08:04 +03:00
Igor Yakovlev 4b8f1bb362 [ULC] Add LanguageVersionSettings to CliLightClassGenerationSupport
+ refactoring
2020-09-11 12:49:04 +03:00
Roman Artemev a60782f3df [JS IR] Add CLI argument to setup error tolerance policy
-  Make sure dev mode is enabled if code with errors is allowed
2020-09-01 14:53:07 +03:00
Alexander Udalov 77247deb23 IR: add module ir.tree.persistent, copy PIR implementation there
Use PersistentIrFactory in JS IR compiler entry points.
2020-07-28 19:04:43 +02:00
Alexander Udalov db4cbe7103 IR: use IrFactory in SymbolTable 2020-07-28 12:05:23 +02:00
Alexander Gorshenev de79e3bec3 Added -Xdisable-fake-override-validator 2020-06-29 21:58:31 +03:00
Anton Bannykh da79f93c61 JS IR: per-module .js generation support 2020-06-26 17:55:33 +03:00
Ilya Matveev e4f4b4eef0 [JS IR] Support setting custom module name (= unique name)
Required for #KT-36721.
2020-04-22 10:50:26 +07:00
Zalim Bashorov 415893b8aa [JS CLI] revert disabling NI by default 2020-03-13 01:51:24 +03:00
Zalim Bashorov f60d0b2c7c [JS IR CLI] Change K2JsIrCompiler#executableScriptFileName's body to TODO() and provide a proper fix later 2020-03-11 12:54:39 +03:00
Zalim Bashorov 2a7e32d3ae [JS IR DCE] Add CLI option to print reachability info 2020-03-11 12:54:39 +03:00
Mikhail Zarechenskiy d1a8f57740 Disable New Inference in JS backend
See #KT-37163 for details
2020-03-02 18:03:41 +03:00
Zalim Bashorov 6f61ea7f67 [JS DCE] Add an ability to define overwriting strategy when copying dependencies in dev-mode
* CLI option "-Xdev-mode-overwriting-strategy"
* System Property "kotlin.js.dce.devmode.overwriting.strategy"

Possible values: "older", "all".

#KT-36349 Fixed
2020-02-20 19:10:29 +03:00
Anton Bannykh 1e96c3d21e DCE-driven mode
:js:js.tests:jsIrTest works same as before
:js:js.tests:jsPirTest runs tests in DCE-driven mode
2020-02-06 21:03:41 +03:00
Alexander Udalov f4912ed433 Minor, simplify JS-related build files a bit
* remove test roots in modules which have no tests
* 1.8 is already the default JVM target in the project
* replace compilation dependency on kotlin-reflect with runtime
2020-01-29 18:03:22 +01:00
Alexander Udalov d27bb76fd0 Remove dependency of serialization.js on cli
To break up compilation dependency of JS IR/WASM backends on JVM
backend.

 #KT-35854 Fixed
2020-01-29 18:03:22 +01:00
Alexey Tsvetkov 2d598d50d7 Expand compilation scope for IC before backend is run
Sometimes IC raises compilation errors when rebuild succeeds.
This happens because IC uses serialized decriptors
for non-dirty files. Serialized descriptors can be different
from source file descriptors. For example, a source file
may contain an implicit return type or an implicit visibility
for overridden methods, but serialized descriptors always
contain explicit return types & methods' visibilities.

These problems can be solved by expanding a scope of incremental compilation
just after the analysis, but before error reporting & code generation.
In other words, we need to compare descriptors before error reporting and code generation.
If there are new dirty files, current round of IC must be aborted,
next round must be performed with new dirty files.

This commit implements IC scope expansion for JS Klib compiler

    #KT-13677
    #KT-28233
2020-01-21 16:36:36 +03:00
Alexey Tsvetkov 4f3418dc89 Minor: use CompilerConfiguration#putIfNotNull for IC services 2020-01-21 16:36:36 +03:00
Svyatoslav Kuzmich fbf71be30c [JS IR BE] Support mode of linking multiple klibs without .kt files 2020-01-14 18:00:29 +03:00
Svyatoslav Kuzmich 3df8393ede [JS IR] Properly report compiler errors
Report compiler errors using message collector
Instead of crashing with stack trace
2019-12-17 15:33:43 +03:00
Alexander Gorshenev a923e0d130 Only allow version triples for klib metadata and ir versions 2019-11-30 18:37:38 +03:00
Alexander Gorshenev b0f077ff4b Plumbing KlibMetadataVersion and KlibIrVersion values to klib manifest 2019-11-30 18:37:38 +03:00
Anton Bannykh 81699299f5 JS_IR: DCE
Could be enabled by toggling `-Xir-dce`

Box test output in js/js.translator/testData/out-min
2019-11-26 12:20:39 +03:00
Svyatoslav Kuzmich 42c4591df8 [JS IR] Add -Xgenerate-dts CLI argument 2019-11-12 18:19:06 +03:00
Nikolay Krasko 155a760ee9 Revert "Revert [JS IR] commits that failed build"
This reverts commit 740f851a
2019-11-07 16:24:13 +03:00
Nikolay Krasko 740f851a10 Revert [JS IR] commits that failed build
Revert "[JS IR] Build hybrid versions of stdlib and kotlin.test"
This reverts commit b9f88350dd.

Revert "[JS IR] Add gradle plugin integration tests"
This reverts commit d872b27663.

Revert "Update bootstrap"
This reverts commit bc47594c7a.

Revert "[JS IR] Support generating both IR and pre-IR libraries"
This reverts commit 1b8df45bfe.
2019-11-05 13:58:39 +03:00
Svyatoslav Kuzmich 1b8df45bfe [JS IR] Support generating both IR and pre-IR libraries
Remove all previous -Xir options

Add:
 -Xir-produce-klib-dir
 -Xir-produce-klib-file
 -Xir-produce-js
 -Xir-only
2019-11-01 19:42:05 +03:00
Vitaliy.Tikhonov f59e393e37 [CLI] add support running scripts in js compiler, extract common code with jvm part 2019-10-10 12:52:06 +03:00
Alexander Gorshenev c2c88a9ee6 Use MessageCollector.NONE as a dummy logger collector for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev 71eb413350 Attached library resolver to messge collector 2019-10-08 16:56:29 +03:00
Alexander Gorshenev 47fba2ee4b A couple of fixes for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev b7a0546634 The friend module identification has regressed recently 2019-10-08 16:56:29 +03:00
Alexander Gorshenev c227c13799 Commonizing klib metadata between native and js 2019-10-01 17:38:57 +03:00
Anton Bannykh ead8379c50 JS: add -Xmetadata-only flag for JS common code modules (KT-33142 fixed) 2019-09-27 19:12:03 +03:00
Svyatoslav Kuzmich 9594e9b3b1 [JS IR BE] Initial export generation 2019-08-30 13:15:37 +03:00
Nikolay Krasko beb1bc09d4 Update to 192.5118.30 2019-06-25 11:48:59 +03:00
Roman Artemev cc46657c99 [JS IR BE] Fix misprint 2019-06-14 18:40:59 +03:00
Vyacheslav Gerasimov 5a39c637c2 Build: Fix intellij dependency leak from ir tree module 2019-06-13 21:03:55 +03:00