Commit Graph

264 Commits

Author SHA1 Message Date
Ilya Goncharov 7ae85ed68e [JS IR] Module descriptors depends on each other 2023-01-23 16:16:48 +00:00
Roman Efremov 14b4cdc7c4 Write "hasEnumEntries" flag into metadata when feature enabled
^KT-53929 Fixed
2023-01-23 12:53:04 +01:00
Alexander Korepanov dd268d67ff [JS IR IC] Use fingerprints form klib && use 128 bytes hash
Optimization: instead of calculating fingerprints manually each time
 the patch allows using precalculated fingerprints from the klib.

 Optimization: share one md5 digest for all IC infrastructure.
2023-01-17 15:48:36 +00:00
Vladimir Sukharev 924898afb7 [K/N] KFC-446: K2 platform: Native alpha
Merge-request: KT-MR-7905
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-04 16:10:40 +00:00
Alexander Korepanov 3744fbb31b [JS IR] Write IrFile fingerprints to KotlinJs klib manifest
The file fingerprints are going to be used for
 a cache invalidation in JS IR incremental cache.

 It should reduce an incremental rebuild time in JS BE.

 CityHash128 is used as IrFile fingerprint.
2023-01-03 12:30:23 +00:00
Dmitriy Novozhilov 5d6cb2b691 [Test] Use IrPluginContext for searching declarations for DUMP_EXTERNAL_CLASS check 2022-12-09 12:02:07 +00:00
Artem Kobzar 76e629340f [K/JS] Add miss LazyIr into klib Ir generation process 2022-12-02 13:28:18 +00:00
Sergej Jaskiewicz 1539d7ef1a [klib] Bring package names in sync with the directory layout
Basically, some package names were Native-specific, whilst the packages
themselves were not Native-specific at all. This was already reflected
in the directory layout, but not in the package names.
This is fixed here.

NFC, just an automatic rename of packages with fixes of imports.
2022-12-01 21:46:43 +00:00
Ilya Chernikov fa0cda6236 FIR JS: enable full JS box tests with FIR 2022-11-12 14:34:07 +01:00
Ilya Chernikov 0fbc099d32 FIR JS: Refactor Klib serialization for FIR support 2022-11-12 14:34:07 +01:00
Ilya Chernikov 8bf108dc17 FIR JS: Prepare JS/KLib infrastructure for FIR integration
rearrange declarations, abstract things that should be done differently
with FIR, etc.
2022-11-12 14:34:07 +01:00
Dmitriy Dolovov 71d51801ce [IR] Partial linkage fix: Implement abstract fake overrides in non-abstract classes so that there are no call sites that still refer to abstract fake overrides
^KT-53663
2022-10-20 10:18:54 +02:00
Dmitriy Dolovov 460e21c7bc [IR][JS] Partial linkage: Enable PL for IR IC compiler 2022-10-19 13:46:22 +00:00
Dmitriy Dolovov 15635482aa [IR] Partial linkage: Enable it by just passing a boolean flag to IR linker constructor 2022-10-19 13:46:22 +00:00
Dmitriy Dolovov a0fdf08b56 [IR] Partial linkage: unify UnlinkedDeclarationsSupport for JS and Native backends 2022-10-19 13:46:21 +00:00
Artem Kobzar 9a4a30c9bb [K/JS] Add flag for disabling signature uniqueness checks at klib generating phase 2022-10-14 13:08:58 +00:00
Artem Kobzar 73e7053c35 [K/JS] Use only single variant of default arguments function wrapper for exported and not-exported functions 2022-09-19 17:49:04 +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
Dmitriy Dolovov e4556ecc0d [IR] User-friendly message about unexpected unlinked symbols
^KT-53649
2022-09-13 17:12:13 +00:00
Nikita Bobko 8f79e833a8 Drop all redundant kotlin-reflect, kotlin-reflect-api dependencies
Review: https://jetbrains.team/p/kt/reviews/6753

All redundant I managed to find, of course.

Why: I'm going to process all reflect dependencies in the next commits.
Cleanup reflect dependency before processing.

They are redundant because:
1. if `compileOnly` then compilation didn't break after dropping the
   dependency
2. if `test*` then tests didn't break after dropping the dependency.
3. `analysis/analysis-api-fir/analysis-api-fir-generator/build.gradle.kts`
   `compiler/fir/checkers/checkers-component-generator/build.gradle.kts`
   Drop `implementation(project(":kotlin-reflect-api"))` because the
   module already depends on
   `implementation(project(":kotlin-reflect"))`
4. `compiler/daemon/daemon-client/build.gradle.kts`. Drop `runtimeOnly`
   because after dropping `compileOnly` compilation didn't break (so
   `runtimeOnly` looks suspicious). Less safe than 1-3
2022-08-22 15:42:57 +02:00
Dmitriy Dolovov 532b9e2c5f [Native][IR] Partial linkage support for cached inline functions
- Support partial linkage for declarations from inline functions that are lazily deserialized from a KLIB with static cache
- Linker API: Split IrModuleDeserializer.deserializeIrSymbol() into deserializeIrSymbolOrFail() and tryDeserializeIrSymbol()
- Linker API: Refactor KotlinIrLinker.handleSignatureIdNotFoundInModuleWithDependencies() to deserializeOrReturnUnboundIrSymbolIfPartialLinkageEnabled()

^KT-52478
2022-07-18 17:29:50 +02:00
Dmitriy Dolovov 2cf5d26edc [IR] JsIrLinker: Drop excessive maybeWrapWithBuiltInAndInit() function
^KT-52478
2022-07-18 17:29:50 +02:00
Mikhail Glukhikh 18a5b3b518 Drop unnecessary usages of OptIn(ObsoleteDescriptorBasedAPI) 2022-07-13 13:11:48 +00:00
Artem Kobzar ef157b5b2e [K/JS] chore: rewrok klib generating with LazyIr. 2022-06-13 12:13:22 +00:00
Ivan Kylchik f3252334b2 Move most of ir utils from backend.common to ir.tree 2022-05-18 21:20:03 +03: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
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
Ilya Goncharov 32cda8a37e [JS IR] Fix cache format, module name one the second line 2022-01-31 12:00:12 +00:00
Georgy Bronnikov 836925b4be JVM_IR: replace calls to expect declarations in ExprectDeclarationRemover
References to expect declarations still remain in IrTypes;
we will need to remove those as well sooner or later.
2022-01-27 01:02:18 +03:00
Dmitriy Dolovov 319125607e [IR, JS] Refactoring: Introduce JsUnlinkedDeclarationsSupport
^KT-50775
2022-01-26 13:36:23 +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
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
Anton Bannykh 4c33cb8016 [JS IR] IC: support per-module in K2JsIrCompiler 2021-12-22 10:14:33 +03:00
Anton Bannykh 4d8926cf26 [JS IR] IC: support per-module layout 2021-12-22 10:13:07 +03:00
Anton Bannykh 434c23a343 [JS IR] IC: avoid conflicts in local declaration signatures 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
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Roman Artemev fb84287ae0 [KLIB] Compute relative path instead of absolute if relative base is provided
- normalize  path if required
 - path it in JS/Native
 - path null for JVM (temporary)
 - fix build
2021-12-15 21:13:52 +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 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
Roman Artemev 53a65f818f [KLIB] Support partially linked klibs in Ir linker
Now it's possible to compile against klib even if in there are
references to declarations from other klibs which are no longer existed

 - add switch flag to turn on/off that mode
 - pass switch flag from JS CLI to JS Linker
2021-11-19 01:16:35 +03:00
Roman Artemev 650b04b4dd [JS IR] Make assert checks no unbound symbols left conditional 2021-11-19 01:16:34 +03:00
Anton Bannykh 75368a2c06 [JS IR] tie together IC code in tests and K2JsIrCompiler 2021-11-19 00:39:37 +03:00
Alexander Udalov 27cfcb9b3d IR: fix thisReceiver parameter type for function classes
Incorrect builder was used at line 269, which led to non-sensible type
in `IrClass.thisReceiver` for function types, such as
`SuspendFunction1<SuspendFunction1, SuspendFunction1>` in the linked
issue.

Avoid creating types manually completely to simplify this code and fix
the bug.

 #KT-49168 Fixed
2021-11-10 21:58:41 +01:00
Svyatoslav Kuzmich 03c352c11e [Wasm] Lower complex external declarations
- Properties
- Member functions
- Object declarations
- Constructors
- Classes with instance checks
2021-11-10 19:48:11 +03:00
Ivan Kylchik 701a10d643 Split some functions of js compiler to be able to use them in tests 2021-11-08 23:50:33 +03:00