Commit Graph

97385 Commits

Author SHA1 Message Date
Artem Daugel-Dauge 243c529a40 Add to pod-dependencies .def indication to link against corresponding framework
^KT-55579 Verification Pending

Merge-request: KT-MR-8109
Merged-by: Artem Daugel-Dauge <Artem.Daugel-Dauge@jetbrains.com>
2023-01-09 09:57:40 +00:00
Alexander Korepanov 5f10e605a9 [JS IR] Don't check an interface method default impl during JS translation
We do not need to check a default implementation of the interface during
 the translation to JS because it must be checked before.

 Moreover, this check breaks the produced JS code
 if IR is partial loaded, e.g. during the incremental rebuild.

^KT-55716 Fixed
2023-01-09 09:46: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
Nikolay Lunyak e6efde76dc [FIR JS] Reuse declarations from JsStandardClassIds in both frontends 2023-01-09 08:57:13 +00:00
Nikolay Lunyak 5817155616 [FIR JS] Implement FirJsNameChecker 2023-01-09 08:57:12 +00:00
Nikolay Lunyak 2f9831ed99 [FIR JS] Stop reporting NON_MEMBER_FUNCTION_NO_BODY for js natives 2023-01-09 08:57:12 +00:00
Nikolay Lunyak 85bcef537c [FIR JS] Support NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE 2023-01-09 08:57:12 +00:00
Nikolay Lunyak 5b3a73f7cd [FIR JS] Implement FirJsNativeAnnotationChecker 2023-01-09 08:57:12 +00:00
Nikolay Lunyak a20e29e8b7 [FIR JS] Implement FirJsExternalChecker
The JsAllowValueClassesInExternals feature is enabled explicitly,
because otherwise it's enabled
implicitly depending on the backend. See:
org/jetbrains/kotlin/test/builders/LanguageVersionSettingsBuilder.kt:90

A property may have a fake source return kind, while its accessor
has a real source kind. In this case we can't "just copy"
the property return type down to the accessor.
2023-01-09 08:57:11 +00:00
Nikolay Lunyak 7b8f5f9980 [FIR JS] Implement FirJsRuntimeAnnotationChecker 2023-01-09 08:57:11 +00:00
Nikolay Lunyak 56285bb2d6 [FIR JS] Report CALL_TO_DEFINED_EXTERNALLY_FROM_NON_EXTERNAL_DECLARATION 2023-01-09 08:57:11 +00:00
Nikolay Lunyak 4cf8d9ffb9 [FIR JS] Implement FirJsInheritanceChecker 2023-01-09 08:57:10 +00:00
Nikolay Lunyak 9e1c6f2f61 [FIR JS] Support DYNAMIC_SUPERTYPE 2023-01-09 08:57:10 +00:00
Nikolay Lunyak 227969d787 [FIR JS] Support DYNAMIC_RECEIVER_NOT_ALLOWED 2023-01-09 08:57:10 +00:00
Nikolay Lunyak 0f876f665a [FIR JS] Support DELEGATION_BY_DYNAMIC 2023-01-09 08:57:09 +00:00
Nikolay Lunyak 95b589fd94 [FIR JS] Support DEBUG_INFO_DYNAMIC 2023-01-09 08:57:09 +00:00
Nikolay Lunyak eed2fada1f [FIR JS] Support WRONG_MULTIPLE_INHERITANCE 2023-01-09 08:57:09 +00:00
Nikolay Lunyak 0426f35684 [FIR JS] Report JS_MODULE-related diagnostics 2023-01-09 08:57:08 +00:00
Nikolay Lunyak f422a3a4e8 [FIR JS] Report WRONG_JS_QUALIFIER for the argument of JsQualifier 2023-01-09 08:57:08 +00:00
Nikolay Lunyak 73c89a5d9d [FIR JS] Prepare the test data for FIR 2023-01-09 08:57:08 +00:00
Nikolay Lunyak 0e38d0ebd2 [FIR JS] Ensure JS-specific diagnostics are generated properly 2023-01-09 08:57:07 +00:00
Nikolay Lunyak 5ae9444745 [FIR JS] Add a test runner for FIR JS with old diagnostic tests 2023-01-09 08:57:07 +00:00
Vladimir Dolzhenko 4466b2c980 Mark KtStubElementTypes#FILE will be deleted in 1.9.0
#KT-53781
2023-01-08 21:43:26 +01:00
Abduqodiri Qurbonzoda 4af0f110c7 Fix 'Test: stdlib-js public kotlin api test' IDEA run configuration
Moving tests to another package made the IDEA run configuration obsolete.
To prevent this problem in the future a separate task (jsStdlibApiTest)
was introduced. The task is run in TC and will fail if the tests are missing.

Merge-request: KT-MR-8128
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-01-07 12:30:52 +00:00
Dmitrii Gridin 0e23ffcec9 [LC] add test on Throws annotation 2023-01-06 21:09:44 +00:00
Dmitrii Gridin 5a74fec3ac [AA] KtAnnotated: split hasAnnotation to two extensions 2023-01-06 21:09:43 +00:00
Dmitrii Gridin 2c305b46df [SLC] SymbolLightSimpleMethod: simplify isOverride for top level functions 2023-01-06 21:09:43 +00:00
Dmitrii Gridin 4d258d7f74 [SLC] AbstractSymbolLightClassesParentingTest: cover more cases 2023-01-06 21:09:43 +00:00
Dmitrii Gridin 7dbffa3a1f [SLC] SymbolLightClassForFacade: add missing parent to modifier list in case of JvmMultifileClass 2023-01-06 21:09:42 +00:00
Dmitrii Gridin 5a081e8291 [SLC] implement missing accept for SymbolLightParameterList and SymbolLightModifierList 2023-01-06 21:09:42 +00:00
Dmitrii Gridin a05842400c [SLC] SymbolLightClassForFacade: reduce access to visibility 2023-01-06 21:09:42 +00:00
Dmitrii Gridin 96aa067aad [SLC] createPropertyAccessors: simplify condition 2023-01-06 21:09:41 +00:00
Dmitrii Gridin 2dfa4d37ea [SLC] SymbolLightMethod: avoid resolve to calculate isOverride 2023-01-06 21:09:41 +00:00
Dmitrii Gridin 6cea761b6e [SLC] reduce resolve from ANNOTATIONS_ARGUMENTS_MAPPING to TYPES phase on annotations search 2023-01-06 21:09:41 +00:00
Dmitrii Gridin 4626b19fce [AA] KtAnnotated: introduce more flexible search API 2023-01-06 21:09:40 +00:00
Dmitrii Gridin 461682a797 [LC] createField: avoid body resolve in case of psi declaration 2023-01-06 21:09:40 +00:00
Dmitrii Gridin 5950820787 [AA FIR] KtFirScopeProvider: avoid redundant resolve 2023-01-06 21:09:40 +00:00
Dmitrii Gridin c522c6e29d [SLC] SymbolLightClassBase: add more diagnostics 2023-01-06 21:09:39 +00:00
Dmitrii Gridin 7982d33677 [AA FIR] mapAnnotationParameters: improve logging 2023-01-06 21:09:39 +00:00
Ilya Kirillov ae68f08856 [FIR] make FirJavaClass.superTypes to be lazily enhanced
This should solve the problem with deadlocks/performance in the K2 IDE

This is a temporary solution until the ^KT-55387 is properly fixed

^KT-55387
^KT-54890
2023-01-06 18:55:43 +00:00
Ilya Goncharov cf8b1692ca [Gradle, JS] Remove base plugin applying in NodeJsRootPlugin and dependencies on clean task 2023-01-06 17:37:12 +00:00
Ilya Goncharov f1aedc74da [Gradle, JS] Use mjs extension for wasm in webpack task 2023-01-06 17:33:16 +00:00
Svyatoslav Scherbina 5320fbeb6e K1: support pre-release checks for klibs
This commit makes the compiler read the pre-release flag from loaded
klibs. Now the K1 frontend checks this flag in
MissingDependencyClassChecker checker, reporting errors if the current
compiler configuration doesn't allow using pre-release dependencies.

^KT-54905 Fixed
2023-01-06 16:57:39 +00:00
Svyatoslav Scherbina 7788304645 Change klib PRE_RELEASE flag value to ignore it set in existing klibs
JsAllowValueClassesInExternals language feature had UNSTABLE_FEATURE
kind and was enabled by default for JS IR backend. As a result, klibs
compiled with recent compiler versions were marked with the pre-release
flag.

Now, if we enabled reading the flag from klibs, the JS IR compiler would
reject all these klibs by default. To fix that, this commit changes the
flag value from 0x1 to 0x2, so that all previously compiled klibs are
treated as not having the pre-release flag.
2023-01-06 16:57:39 +00:00
Svyatoslav Scherbina 4db7bac4c0 Switch JsAllowValueClassesInExternals kind from UNSTABLE_FEATURE to OTHER
When a language feature has UNSTABLE_FEATURE kind, enabling it causes
the compiler to mark the compiled library with the pre-release flag.

JsAllowValueClassesInExternals feature is enabled by default in JS IR
backend. So effectively, all JS klibs are marked with the pre-release
flag. This remained unnoticed because the compiler currently doesn't
read this flag from klibs. This will change soon.

To fix the problem, this commit changes the feature kind to OTHER, which
doesn't enforce the pre-release flag.
2023-01-06 16:57:38 +00:00
Svyatoslav Scherbina 0f63cfecbd Introduce KlibMetadataHeaderFlags
This class lists possible flags for KlibMetadataProtoBuf.Header, and
helps avoid using magic constants in the source code.
2023-01-06 16:57:38 +00:00
Svyatoslav Scherbina d9ba950d7b Introduce KlibDeserializedContainerSource
It is a DeserializedContainerSource implementation for deserializing
metadata from klibs.
2023-01-06 16:57:38 +00:00
pyos 923837f26b FIR: keep nullability when serializing suspend function types
No clue where to put the test for that since diagnostic tests, even
multi-module ones, never touch the metadata serializer. So the test is
a bytecode text one pretending to be about nullability annotations even
though it also affects what resolution in another module will do.
2023-01-06 13:54:35 +01:00
Troels Bjerre Lund ec891474b0 [K/N] custom-alloc: AtomicStack avoid loop on move ^KT-55364
This change avoids looping through the source stack, looking for the
last element, in the case where the target stack is empty. This could
matter in two places:

* when merging ready_ and used_ into unswept_ in PrepareForGC. The first
  of these will be faster with this change.
* when merging finalizer queues (in CR-592, not merged yet), where we
  expect the target queue to be empty.

Since we can expect used_ to be larger than ready_, since we are about
to do a GC, the order of these two has also been reversed.


Co-authored-by: Troels Lund <troels@google.com>

Merge-request: KOTLIN-MR-599
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-01-06 12:44:28 +00:00
Troels Bjerre Lund e04c6220ff [K/N] custom-alloc: free largepages on sweep ^KT-55364
The default behavior on a sweep is to push empty pages into a separate
stack, which will be freed if not used before the next GC starts. This
serves two purposes: it reduces the number of system allocations, and it
avoids a race condition inside AtomicStack::Pop.

Neither of these are relevant for LargePages, since LargePages are never
reused and it is only the GC thread that calls
AtomicStack<LargePage>::Pop. The change is to free LargePages
immediately instead of waiting for the next GC cycle.


Co-authored-by: Troels Lund <troels@google.com>

Merge-request: KOTLIN-MR-598
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-01-06 12:43:46 +00:00