Commit Graph

214 Commits

Author SHA1 Message Date
Ilya Goncharov 025e335b0f [JS IR] Add more granularity to find enum related declarations
^KT-37916 fixed
^KT-44494 fixed
2021-11-01 13:28:20 +00:00
Svyatoslav Kuzmich 4fc461a2ff [Wasm] Imporove external interface support
* Support boxing/unboxing when casting to Any
* Support ===, equals, hashCode, toString

* Support adapting String in interop boundary
2021-10-23 01:26:12 +03:00
Svyatoslav Kuzmich a6afb7cb41 [JS IR][Wasm] Preload (Suspend)FunctionN needed in lowerings
This reverts commit 15d178d850d15675ee39cbd833d13f4c8aed83ff.
2021-10-12 08:42:01 +03:00
Svyatoslav Kuzmich 3bce0cc055 [Wasm] Support coroutines
- Reuse JS IR Suspend function lowering
  - Fix types
  - Disable reinterpretCast-based optimization for inline
    classes
- Add basic support to Wasm stdlib
- Explicitly transform suspend functions into regular functions
  with continuations
- Clean suspend function handling from JS IR codegen
2021-10-12 08:42:01 +03:00
Svyatoslav Kuzmich 9ef899ef10 [Wasm] Reuse Callable reference and SAM lowerings from JS 2021-10-08 07:24:41 +03:00
Svyatoslav Kuzmich 1ed2748334 [Wasm] Generate [K][Suspend]FunctionN on demand and support big arity 2021-10-08 07:24:41 +03:00
Roman Artemev e6de812788 [IR] Implement checker for friendship of modules in fake override builder
- pass corresponding information to FO builder
 - implement check
 - fix KT-47192 and KT-48673
2021-10-07 16:00:49 +03:00
Roman Artemev ba759fb61b [IR] Fix compatibility mode
- pass corresponding flag to mangler
 - properly handle local declarations in field initializers
 - fix KT-48912
2021-10-06 03:47:20 +03:00
Georgy Bronnikov 8a459821d0 JVM_IR: avoid double encoding of byte strings
IrLibraryFile, ingerited from Klib code, needed types, bodies, strings,
signatures encoded as byte strings.
When we store this data as class annotations, it is better to store it
as protobuf structs, to avoid re-encoding byte streams twice.
2021-10-01 00:58:06 +03:00
Roman Artemev 4bd6e8a034 [JS IR] Pass dirty files into backend and load IR for them only 2021-09-30 14:30:12 +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
Roman Artemev 7f424732bf [JS IC] Make API to store d.ts and sourceMap IC data 2021-09-20 12:23:35 +03:00
Roman Artemev f85a59b7f3 [JS IC] Write cache info in per-file mode too
- make sure that file is existed and not crashes the compiler
2021-09-20 12:23:35 +03:00
Roman Artemev a55be02007 [JS IC] Support binary ast in disk cache 2021-09-20 12:23:34 +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
Roman Artemev 6b2fee7143 [JS IC] Add holder class for incremental codegen cache 2021-09-13 13:44:54 +03:00
Roman Artemev 08aa909569 [JS IC] Add API to save/restore binary AST into IR codegen cache
- Add EMPTY stubs for cache accessors
2021-09-13 13:44:49 +03:00
Roman Artemev 78cd45f937 [KLIB] Resolve deserialization on for each file separately
Needs for IC
2021-09-07 20:41:28 +03:00
Roman Artemev 1f11aa00c0 [JS IC] Implement IC cache provider and consumer to access IC data 2021-08-24 01:09:16 +03:00
Roman Artemev 76690c081a [KLIB] Provide required API for IC invalidation 2021-08-24 01:09:16 +03:00
Roman Artemev 35e16d2db6 [JS IC] Extract PIR cache IO into separate functions 2021-08-24 01:09:13 +03:00
Ting-Yuan Huang e75ca75e3e K2JsIrCompiler: hoist common front-end preparation logic
Instead of creating ModuleStructure and run analysis in each backend,
the common preparation logic is moved into K2JsIrCompiler.doExecute().
2021-08-12 18:01:56 +03:00
Dmitriy Dolovov c1fb40a436 [IR] Enhance error reporting for IR linking issues
^KT-44626

Typical use case:
- There are two KLIB libraries: A and B.
- Library A has two versions: A.v1 (older) and A.v2 (newer).
- A.v2 is ABI-incompatible with A.v1.
- B depends on A and was compiled against A.v1.
- An attempt to build the application with A.v2 and B fails with weird error message. It's unclear for end user what's wrong and what needs to be done to fix the issue.

The fix improves error reporting for the following particular cases:
- A symbol that is gone (KT-41378)
- A class that became a typealias (KT-47285, KT-46697)
- A typealias that became a class (KT-46340)
2021-08-10 14:02:40 +03:00
Ilya Goncharov 2f0f88062a [JS IR] Change global map in context to mapping
^KT-46204 fixed
2021-08-10 07:24:50 +00:00
Roman Artemev 7add820f0d [JS IC] Simplify code a bit 2021-08-06 20:49:17 +03:00
Roman Artemev 9bfe502afd [JS IC] Fix signature finding in some cases
Found in KFSAD
2021-08-06 20:49:13 +03:00
Roman Artemev 297e0a9f43 [JS IC] Improve IC deserializer code a bit 2021-08-06 20:49:11 +03:00
Roman Artemev 6ca87dc43f [KLIB] Drop useless set 2021-08-06 20:49:10 +03:00
Roman Artemev aeea7147fe [JS IC] Simplify code a bit more 2021-08-06 20:49:09 +03:00
Roman Artemev b1eeb1fb27 [JS IC] Don't persist temporary copies of inline functions
- drop special `IrValueParameterPublicSymbol`
 - drop special `IrAnonymousInitializerPublicSymbolImpl`
 - drop hacky `useGlobalSignatures`
2021-08-06 20:49:06 +03:00
Roman Artemev b1251c1716 [JS IC] Drop special IdSignatureSerializer for IC 2021-08-06 20:49:04 +03:00
Roman Artemev 74d8e16d09 [JS IC] Eradicate GlobalFileLocalSignature from code
- Reduce usage of global maps
2021-08-06 20:49:02 +03:00
Roman Artemev a0449892b2 [JS IC] Simplify signatures, don't use GlobalScopeLocalDeclaration 2021-08-06 20:49:01 +03:00
Roman Artemev 3d3c70141c [JS IC] Properly handle type parameters of Functional interfaces
- drop redundant `IrSymbolTable` and `IrIcModuleDeserializerWithBuiltIns`
2021-08-06 20:48:59 +03:00
Anton Bannykh 508d3bd9c0 JS IR IC: IC data may reference additional original declarations
Function types, which are created on the fly from lowerings are one such example.
2021-07-23 17:10:06 +03:00
Anton Bannykh fa21132704 JS IR IC: fix order storage
Some classes don't survive till the end. Their declaration lists
need to be stored nevertheless.
2021-07-23 17:10:06 +03:00
Anton Bannykh c6ab195a87 JS IR IC: invalid loops references exist after lowerings 2021-07-23 17:10:04 +03:00
Anton Bannykh 0130d18ea9 JS IR IC: deserialization fix 2021-07-23 17:10:03 +03:00
Roman Artemev 0310f7cb0b [JS IC] Lot of fixes after rebase 2021-07-22 21:56:57 +03:00
Roman Artemev 8782399ffb [JS IC] Make sure already bound symbol is not being enqueued 2021-07-22 21:56:56 +03:00
Anton Bannykh 20088994c1 JS IC: IC lowerings prototype 2021-07-22 21:56:55 +03:00
Ilya Chernikov db61665ab8 [minor] IR: clean unnecessary ObsoleteDescriptorBasedAPI opt-ins 2021-07-21 18:05:42 +03:00
Ilya Chernikov dee0487185 IR: Refactor IrBuiltIns to abstract it from descriptors 2021-07-16 02:24:18 +03:00
Roman Artemev 0326518fc9 [KLIB] Cutting down usages of moduleDescriptor in linker
Replace map key `ModuleDescriptor` with `String` which is module name
2021-07-13 14:43:42 +03:00
Roman Artemev 0a49b24320 [JS IR] Move klib resolution from cli into compiler
Simplify CLI -> Compiler API
Clean up code
2021-07-13 14:43:40 +03:00
Alexander Udalov 2834c22a85 IR: add BackendContext.typeSystem and JvmIrTypeSystemContext
To be able to override JVM-specific behavior of IrTypeSystemContext in
JVM IR, for things like JVM flexible types.
2021-07-01 19:35:44 +02:00
Roman Artemev a8d0e60328 [JS TESTS] Extend test frame with some features
- Setting up specific ABI version for module
- Disabling mangle verification
2021-07-01 17:40:40 +03:00
Roman Artemev b8e5185b61 [KLIB] Add extra debug information for Local signatures 2021-07-01 17:40:37 +03:00
Roman Artemev b5c28c1912 [KLIB] Introduce compatible mode for klibs.
Based on library ABI version linker could decide which signature mode
to be used to guarantee backward compatibility.
2021-07-01 17:40:36 +03:00
Roman Artemev 6cdac22a23 [IR] Introduce new IdSignatures
FileSignature, CompositeSignature, LocalSignature

They are needed to make possible reference any non-local declaration via
 signature, including private signature, type parameters and so on.

- Support those new signatures in proto and klibs
- Rename `isPublic` -> `isPubliclyVisible` due to changed semantic
- Fix FIR
- clean up code
2021-07-01 17:40:31 +03:00