Commit Graph

1032 Commits

Author SHA1 Message Date
Alexander Korepanov 8fe4e9030f [JS IR] Add an implicit cast to int for the mod operation
^KT-45620 Fixed
2022-01-18 12:01:37 +00:00
Sergej Jaskiewicz ceb744b53b Revert "[JS IR] [runtime] Remove valueOf method from Long"
This reverts commit e13b6b2a90.

The significance of the breakage caused by the removal of `valueOf`
was underestimated.

#KT-50202 Open
2022-01-18 10:33:54 +00:00
Evgeniy.Zhelenskiy e97ca2ada4 [Psi2Ir, Fir2Ir] Generate toString, hashCode, equals methods for MF VC 2022-01-14 13:51:57 +00:00
Igor Yakovlev 82455c849d [WASM] Lazy properties initialization 2022-01-05 13:12:32 +01:00
Alexander Korepanov 4a29a8a7af [JS IR] Update an error on cross-module symbol redeclaration
The temporary solution for KT-50546.

The complete solution requires the understanding,
whether a cross-module symbol redeclaration is a valid case or not.
If the case is valid, the linker symbol table logic must be reworked.
2021-12-30 08:44:11 +00:00
Anton Bannykh 1b631da3a0 [JS IC] fix cross-module nested class references and interface inheritance
^ KT-50528 fixed
2021-12-29 16:04:06 +03:00
Roman Artemev 93e7eb2a8e [JS IR] Cleanup StageController & Lowerings magic a bit 2021-12-24 16:50:47 +03:00
Roman Artemev 7341a17a5d [IR] Cleanup ir serialization 2021-12-24 16:50:44 +03:00
Roman Artemev 4babc30624 [IR] Remove Persistent IR 2021-12-24 16:50:42 +03:00
Roman Artemev 353bfe9018 [JS IR] Cleanup pir IC code 2021-12-24 16:50:40 +03:00
Ilya Goncharov 52ccf3d6ec [JS IR] Not export fun with stable name and default argument
if it is not exported, but just with stable name

^KT-50464 fixed

Merge-request: KT-MR-5324
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
2021-12-23 15:21:00 +00: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 106d3c4c9c [JS IR] minor: eliminate obsolete namer creation 2021-12-22 10:14:08 +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
Anton Bannykh 4d8926cf26 [JS IR] IC: support per-module layout 2021-12-22 10:13:07 +03:00
Anton Bannykh 9b47a321d5 [JS IR] assert there are no clashing declarations 2021-12-22 10:13:07 +03:00
Anton Bannykh 175d722097 [JS IR] save JsIrProgramFragment definitions 2021-12-22 10:13:07 +03:00
Roman Artemev 9b49f0eb70 [JS IC] Support deleted files in IC cache invalidator
- support them in test too
2021-12-21 18:07:56 +03:00
Artem Kobzar ab7615adaf fix: fake override on interfaces. 2021-12-17 14:22:46 +00: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 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
Ilya Goncharov 6adcbe081e [JS IR] Consider erasing type parameters in return type in js signatures 2021-12-13 16:16:59 +00:00
Sergej Jaskiewicz 41acdefce9 [JS IR] Treat char as inline class no matter how it's declared 2021-12-13 07:36:57 +00:00
Sergej Jaskiewicz 4f13717fea [IR] Use InlineClassesUtils in lowerings instead of IrClass.isInline
We do it because sometimes we want to treat a regular class as
an inline class. For example, in the Wasm backend we treat classes
with the `@WasmAutoboxed` annotation as inline classes. Also, in
the JS IR backend the `Char` class is declared as a regular class for
compatibility reasons, but we want it to be an inline class for
performance.
2021-12-13 07:36:56 +00:00
Sergej Jaskiewicz e5993ab594 [JS IR] [Wasm] Extract InlineClassesUtils into CommonBackendContext 2021-12-13 07:36:56 +00:00
Sergej Jaskiewicz 962ca40687 [JS IR] Pass JsIrBackendContext as non-nullable in some functions 2021-12-13 07:36:55 +00:00
Alexander Korepanov bf57e33713 [JS IR] Add an implicit cast to int32 for the shru operator
^KT-20791 Fixed
2021-12-09 14:10:03 +00:00
Alexander Korepanov a34c97ebd5 [JS IR] Generate context dependent names for anonymous objects and classes. 2021-12-09 13:56:25 +00:00
Artem Kobzar b1643075f2 fix(KT-50040): remove the corresponding symbol from top-level accessors. 2021-12-09 13:39:35 +00:00
Roman Artemev dc1155de24 [JS IR] Erase IrErrorType into IrErrorType 2021-12-08 20:18:16 +03:00
Ilya Goncharov 00289d3514 rra/ilgonmic/exported-bridges-2
[JS IR] Use js name for signature

[JS] bridgeSavingExport only for JS IR

[JS IR] Fix test

[JS IR] Stable and non stable signatures

[JS IR] Consider return type in js signature and erase for JS name signature

[JS IR] Copy signature from wasm to JS and export bridge, not original

Merge-request: KT-MR-5174
2021-12-08 08:30:14 +00:00
Ilya Goncharov 0c74376cc4 rra/ilgonmic/after-test-promise
[JS] Node downloading for js ir integration kotlin test

[JS] Fix API of Promise

[JS IR] Promise symbol as lazy2

[JS] Support legacy compiler aftertest with promises

[JS IR] Generate finally for promised tests

[JS] Setup it tests for JS IR kotlin-test

Merge-request: KT-MR-5168

^KT-49738 fixed
2021-12-08 08:22:53 +00:00
Alexander Korepanov 2ae10f4378 [JS IR] Optimize equals call for inline class instances.
Remove implicit boxing of inline class instances in equals call.
2021-12-02 11:00:02 +00:00
Anton Bannykh e6a5614321 [JS IR] don't hash module names 2021-12-01 16:50:30 +03:00
Anton Bannykh e90ad8b53b [JS IR] fix cross-module reference of interface default methods 2021-12-01 16:50:24 +03:00
Sergej Jaskiewicz e13b6b2a90 [JS IR] [runtime] Remove valueOf method from Long
This method was used for coercing `Long` values to JavaScript
`number`. However, it caused issues when `Long` values were
concatenated to a string (see KT-8666, KT-26706).
2021-12-01 12:36:34 +00:00
Anton Bannykh 5b66c4cdc3 [JS IR] speed up temporary name resolving 2021-11-29 21:09:35 +03:00
Anton Bannykh 2259c6f75d [JS IR IC] assert cross-file tag are not null and fix tests 2021-11-29 21:09:35 +03:00
Anton Bannykh 3be44a3540 [JS IR] fix missing signature 2021-11-29 21:09:33 +03:00
Anton Bannykh ef4ef8c930 [JS IR] switch to the IC Ir2Js and fix tests 2021-11-29 21:09:31 +03:00
Ilya Goncharov cac286c915 [JS IR] Access with exported properties by its name, not accessor
[JS IR] Export properties to ts as getter/setter, not fields

[JS IR] Fix typescript tests



Merge-request: KT-MR-5074
2021-11-26 09:18:12 +00: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
Ilya Goncharov 1481ad21f5 Enum implementing exported interface
[JS IR] Not export get instance enum function

[JS IR] Enum corresponding class is not considered in export

[JS IR] All enums are abstract and with private constructor

[JS IR] Any methods is left in d.ts

[JS IR] Make enum with declarations inside corresponding class

[JS IR] Export of interface through fake override

[JS IR] Include enum entry corresponding class members into export model

Merge-request: KT-MR-5031

^KT-49779 fixed
^KT-49773 fixed
2021-11-24 12:25:50 +00:00
Ilya Goncharov f48436b35e rra/ilgonmic/eager-like-native
[JS IR] Leave JsEagerInitialization until bootstrap update

[JS IR] Fix js stdlib api

[JS IR] Change annotation on eager initialization in sources

[JS IR] Make eager initialization consistent with native

Merge-request: KT-MR-5030
2021-11-22 12:45:37 +00:00
Sergej Jaskiewicz 756b58d5ce [JS IR] Don't assume a single constructor in the Char class 2021-11-22 11:22:45 +00:00
Kristoffer Andersen be1c0bb9c1 [EE-IR] Support mutations by evaluator fragments
- box captured variables using `Ref`s, the same mechanism that's used
  for shared variables in closures.
2021-11-21 01:34:42 +01:00