Commit Graph

255 Commits

Author SHA1 Message Date
Artem Kobzar 2530cba82a [K/JS] Compile Kotlin coroutines as JS generator ^KT-63038 Fixed 2023-12-18 17:13:07 +00:00
Nikita Bobko 44b1cf6c46 Add docs for different metadata versions and proto files
Review: https://jetbrains.team/p/kt/reviews/8401
In scope of KT-55082
2023-02-01 15:13:34 +01:00
Nikita Bobko 73149fdf0b Cleanup: Use concrete subclass instead of BinaryVersion when possible
Review: https://jetbrains.team/p/kt/reviews/8401

BinaryVersion is a problematic class, because it doesn't represent any
logical entity in the codebase, it's just a way to reuse common logic
for Kotlin versions. But unfortunately, BinaryVersion is used in a lot
of API definitions, which makes code hard to read because it's not
obvious which subclasses are supposed to be passed in the particular
API.
2023-02-01 15:13:34 +01:00
Roman Efremov 878608b7b2 Don't add Enum.entries to scope if it can't be called
^KT-53929 Fixed
2023-01-23 12:53:06 +01:00
Roman Efremov 14b4cdc7c4 Write "hasEnumEntries" flag into metadata when feature enabled
^KT-53929 Fixed
2023-01-23 12:53:04 +01:00
Artem Kobzar 71486a321c [K/JS] Add support of compilation with ES-classes 2023-01-17 18:14:17 +00:00
Alexander Korepanov 155777e3fa [JS IR] Detect broken cross-module references
The patch adds an error if the module can not find the cross-module reference.

 The patch removes the DCE optimization which eliminates implement() intrinsic,
 because it leads to a broken cross-module reference and
 broken JS code with implement() call, albeit in an unreachable block.
2023-01-09 09:23:26 +00:00
Pavel Kunyavskiy 17e9a6a781 [klib] Fix serialization of missing annotations
^KT-42490
^KT-44625
2022-12-20 20:06:51 +00:00
Artem Kobzar e790607af5 feat(KT-51123): save comments from js-function call inside arguments list. 2022-06-13 12:58:18 +00:00
Artem Kobzar 45e3c94a8b feat: add limited support of comments inside js call. 2022-04-11 14:25:46 +00:00
Artem Kobzar 7ef14fc11b chore: use CompositeBlock instead of GlobalBlock. 2022-04-11 10:37:14 +00:00
Artem Kobzar c6136619d2 chore: remove unreadable blocks and use comments instead. 2022-04-11 10:37:13 +00:00
Victor Petukhov b5933c70e2 [FE 1.0] Refactor error utils: split error entities and introduce error type and error scope kinds 2022-03-23 21:13:33 +00:00
Artem Kobzar acc467594f chore: remove unused protobuf message. 2022-02-17 11:54:37 +00:00
Artem Kobzar 804eb61bf0 feat: add polyfills insertion for ES Next used features 2022-02-16 10:49:11 +00:00
Ilya Kirillov 49e9c47071 Move DynamicTypeDeserializer.id from IR module to common module
So, it can be used from cls-psi-stub-builder module
2021-12-27 16:23:06 +03:00
Anton Bannykh 175d722097 [JS IR] save JsIrProgramFragment definitions 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
Anton Bannykh b1b88a0d11 [JS IR] JS AST serialization 2021-10-15 20:14:50 +03:00
Svyatoslav Kuzmich 3f8dce4b53 [JS IR] Support per-file mode and ES modules 2021-10-12 23:29:39 +03:00
Victor Petukhov a264cbfe7d Move CallUtil.kt under the resolve.util package 2021-09-27 16:12:01 +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
Ilmir Usmanov 1f8dd45c2b Remove experimental coroutines support. Part 2 2021-08-30 14:21:57 +03:00
Alexander Udalov 376b420d1a Fix warnings in JS/WASM modules 2021-08-06 22:36:22 +02:00
Mikhail Glukhikh 113d2653aa Drop deprecated -Xexperimental flag from compiler and tests 2021-07-14 21:18:23 +03:00
Alexander Udalov bcf47ddc94 Move optional annotation utilities to module 'resolution'
To avoid depending on a heavy module 'frontend' in parts of the compiler
where checking for optional annotations is needed, such as in
'ir.serialization.common'.
2021-06-01 20:28:22 +02:00
Pavel Kirpichenkov b66f5c8180 Drop type aliases for JS and KLIB string tables
They used to use the same approximation logic anyway
^KT-20996
2021-01-20 11:05:53 +03:00
Pavel Kirpichenkov 2f3f75b512 Fix local anonymous class name error in K2MetadataCompiler
Extract the logic of approximating to denotable class supertype
from JS/KLIB and use it in metadata compiler.

^KT-20996 In Progress
2021-01-20 11:05:53 +03:00
Alexander Udalov cbd90c3af5 Refactor boolean IR ABI stability flag to enum
Introduce an enum DeserializedContainerAbiStability with two values.
This is needed in order to support another reason for ABI instability in
a subsequent commit, namely "unstable because compiled by FIR".

 #KT-43592
2020-12-20 23:14:12 +01:00
Leonid Startsev 4ec90b18bc Rework DescriptorSerializerPlugin to be a part of Project's extensions
instead of statically registering it.

Static registering can cause subtle errors when plugin implementation
(e.g. SerializationDescriptorPluginForKotlinxSerialization) is registered
from multiple classloaders: in multi-module with daemon compilation scenario

 #KT-41857 Fixed
2020-10-22 17:04:35 +03:00
Vladimir Dolzhenko 3c380faeb5 Added deprecated PackageFragmentProvider#getPackageFragments for BWC
Relates to ^KT-33394
^KT-42259 Fixed
2020-09-29 19:14:44 +00:00
Dmitriy Novozhilov a764732020 Rename KotlinBuiltInsNames to StandardNames 2020-08-25 10:41:33 +03:00
Dmitriy Novozhilov 7a7fe77b8e Move static constants with builtin names to :core:descriptors.common module 2020-08-25 10:31:36 +03:00
Leonid Startsev 7c8c5b057f Extensible mechanism for plugin metadata during descriptor serialization
A mechanism that allows kotlinx.serialization plugin to preserve the
correct (program) order of properties after serializing/deserializing
descriptors to kotlin metadata, which is needed for correct and stable
json serialization of class hierarchies in incremental/multi-module scenario.
It uses protobuf extensions.
2020-06-01 17:48:16 +03:00
Alexander Udalov 7bb77e5672 Move JS binary version utilities to 'js.config'
This allows to replace dependency of 'util' on 'deserialization' with
dependency on 'descriptors'.
2020-03-28 21:30:06 +01:00
Alexander Udalov 8dd04789ad Remove obsolete InlineStrategy
Replace corresponding metadata property in js.ast with Boolean. This
allows to get rid of dependency of 'js.ast' on 'frontend'.
2020-03-28 21:30:03 +01:00
Alexander Udalov 953b461c53 Add new compiler errors and flags when JVM compiles against JVM IR
From now on, the old JVM backend will report an error by default when
compiling against class files produced by the JVM IR backend. This is
needed because we're not yet sure that the ABI generated by JVM IR is
fully correct and do not want to land in a 2-dimensional compatibility
situation where we'll need to consider twice more scenarios when
introducing any breaking change in the language. This is generally OK
since the JVM IR backend is still going to be experimental in 1.4.

However, for purposes of users which _do_ need to compile something with
the old backend against JVM IR, we provide two new compiler flags:
* -Xallow-jvm-ir-dependencies -- allows to suppress the error when
  compiling with the old backend against JVM IR.
* -Xir-binary-with-stable-api -- allows to mark the generated binaries
  as stable, when compiling anything with JVM IR, so that dependent
  modules will compile even with the old backend automatically. In this
  case, the author usually does not care for the generated ABI, or s/he
  ensures that it's consistent with the one expected by the old compiler
  with some external tools.

Internally, this is implemented by storing two new flags in
kotlin.Metadata: one tells if the class file was compiled with the JVM
IR, and another tells if the class file is stable (in case it's compiled
with JVM IR). Implementation is similar to the diagnostic reported by
the pre-release dependency checker.
2020-01-29 17:20:41 +01:00
Mikhail Zarechenskiy 0e90d538df FIC: propagate info about conversions for deserialized classes 2020-01-17 19:36:08 +03:00
Mikhail Zarechenskiy 0fdebdfeba Refactoring: move SamConversionResolverImpl to core module 2020-01-17 19:36:07 +03:00
Svyatoslav Kuzmich 7592048437 [JS] Support typeOf 2019-09-25 18:12:55 +03:00
Alexander Udalov b970a57adb Generate version requirement on inline functions since API version 1.4
The old compiler will crash if it tries to inline a function that's
passing a lambda parameter into the new parameter null check method
`Intrinsics.checkNotNullParameter` because that usage is not considered as
inlinable by the old compiler (it only knows about
`Intrinsics.checkParameterIsNotNull`). Therefore we require that these
functions can only be read by compilers of version 1.3.50 or greater.

 #KT-22275 Fixed
2019-08-12 16:09:23 +02:00
Roman Artemev af45e1c5dc [JS BE] Do not produce source mapping for fake KtElement
Fix [KT-26701], [KT-12935]
2019-07-17 10:21:34 +03:00
Anton Bannykh fadeac083f JS: fix reified T::class for primitive T (e.g. Int) (KT-32215 fixed) 2019-06-28 13:49:22 +03:00
Anton Bannykh 8ab9ef2afa JS: don't visit all descriptors on metadata serialization 2019-06-03 15:53:00 +03:00
Anton Bannykh c3170d1908 JS: cache metadata, grouped by package FQN 2019-05-28 23:33:17 +03:00
Anton Bannykh fc7fea4863 JS: make .meta.js the same as before 2019-05-28 23:33:17 +03:00
Anton Bannykh 145ca7b6a9 JS: merge proto parts as bytes 2019-05-28 23:33:17 +03:00
nikita.movshin 65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Alexander Udalov 584137121b Do not write version requirements in metadata for lambdas
#KT-29790 Fixed
2019-03-12 18:53:08 +01:00
Anton Bannykh 4b39e2df12 JS: (review fix) Header -> InlineData 2019-02-14 15:14:28 +03:00