Commit Graph

98207 Commits

Author SHA1 Message Date
Zalim Bashorov 6a73650b35 [Wasm] SpiderMonkey.kt -> WasmVM.kt 2023-01-27 17:57:50 +01:00
Zalim Bashorov b02279de14 [Wasm] Run wasm test using all available VMs: V8 & SpiderMonkey for now
Also, add a new directive, `WASM_FAILS_IN`, to specify VMs where a test is expected to fail for now.

#KT-56166 Fixed
2023-01-27 17:57:50 +01:00
Zalim Bashorov 885381dd63 [Wasm] Change externRefToAny to make it compatible with SpiderMonkey and V8
It's hard to achieve that without implementing part of `externRefToAny` using an intrinsic. It should be rewritten when all VMs and tools update to the latest spec.

Also, stop using (deprecated) instructions unsupported by SpiderMonkey.

#KT-56166 In-Progress
2023-01-27 17:57:50 +01:00
Zalim Bashorov d1855371a0 [Wasm] Don't wrap single null expression into composite in WasmNullCoercingLowering
Otherwise, it breaks check/assert inside DeclarationGenerator::visitField (DeclarationGenerator.kt:458)

#KT-56166 In-Progress
2023-01-27 17:57:50 +01:00
Zalim Bashorov ca79711610 [Wasm] Generate .mjs compatible with other standalone js & wasm VMs: SpiderMonkey and JavaScriptCore in addition to V8
#KT-56166 In-Progress
2023-01-27 17:57:50 +01:00
Zalim Bashorov 802a8ec326 [Wasm] Update SpiderMonkey version
#KT-56166 In-Progress
2023-01-27 17:57:50 +01:00
Zalim Bashorov 1d793f7bec [Wasm] Revert a7ed496a and few fixes to make Kotlin/Wasm compatible with Firefox
Revert changes as soon as the bug is fixed https://bugzilla.mozilla.org/show_bug.cgi?id=1811932

a7ed496a "[WASM] Use wasm bottom types for Nothing?"

#KT-56166 In-Progress
2023-01-27 17:57:49 +01:00
Roman Golyshev 71a368e06e [Analysis API] KTIJ-24107 Fix resolution of qualified invoke calls on objects
^KTIJ-24107 Fixed
^KTIJ-24344 Fixed
2023-01-27 16:49:30 +00:00
Roman Golyshev aab853ad12 [Analysis API] KTIJ-24107 Small cleanup in FirReferenceResolveHelper.kt 2023-01-27 16:49:29 +00:00
Svyatoslav Scherbina f3c29e1707 K2/Native: fix ModuleDescriptor dependencies in fir2ir phase
Previous implementation set Nth ModuleDescriptor dependencies to the
first N modules. This is not always correct: for example, when producing
a metadata klib (-Xmetadata-klib) for HMPP, metadata dependencies might
have inexact or missing depends= in their manifests.

This commit sets ModuleDescriptor dependencies to all other
deserialized modules. The same approach is used for K1. That way, the
implementation is more reliable.

^KT-56071
2023-01-27 16:32:33 +00:00
Svyatoslav Scherbina f6fa78b653 K2/Native: fix builtIns predicate in fir2ir phase
Old implementation expected that builtIns should be based on a library
with no dependencies, usually stdlib. But that doesn't work properly in
some cases, e.g. when producing a metadata klib (-Xmetadata-klib) for
HMPP. In that case, some of the metadata dependencies can have no
depends= in the manifest, leading to the compiler choosing such a module
instead of stdlib.

This commit makes it look for a library that is explicitly stdlib
instead.

^KT-56071
2023-01-27 16:32:32 +00:00
Sergej Jaskiewicz bd18fd40ea [K/N] Remap type args of SAM interfaces in FunctionReferenceLowering
#KT-56188 Fixed
2023-01-27 15:26:32 +00:00
Sergej Jaskiewicz 61fc3e99b1 [K/N] Fix generics in FunctionReferenceLowering for more edge cases
There were still some cases where the generated function reference class
would contain references to generic parameters that were not in scope.
One example of that was `Array<*>::get`. Before this fix the generated
function reference class would still contain a reference to the
type parameter declared in the `Array` class.

Also, the logic of generifying the generated function reference class
was incorrect. For example, for function `fun <A, B> foo()` if we had
a reference `::foo<T, T>` (where `T` comes from the outer scope),
the class would still contain two generic parameter, despite that only
one generic parameter from the outer scope was referenced.
This is also fixed here.
2023-01-27 15:26:30 +00:00
Troels Bjerre Lund 73e420d69d [K/N] custom-alloc: Fix off-by-one in threshold
The existing threshold for determining between medium and large page
does not take the dummy block into account, meaning that an allocation
on the threshold will lead to a loop that only terminates when the
process goes out of memory.


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

Merge-request: KOTLIN-MR-618
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-01-27 14:03:55 +00:00
Ilya Goncharov 1150ec6882 [JS] Implementation dependencies for JS klibs
^KT-56158 fixed
2023-01-27 13:31:59 +00:00
Ilya Goncharov ca0b3ffa78 Upgrade yarn.lock file 2023-01-27 13:30:20 +00:00
Stanislav Ruban 4523535545 Deprecate -Xuse-k2 compiler flag in Gradle DSL
^KT-56239 Fixed
2023-01-27 12:42:50 +00:00
Kirill Rakhman efc957586d FIR: Report EXPLICIT_DELEGATION_CALL_REQUIRED in some missing cases
^KT-55877 Fixed
2023-01-27 12:26:51 +00:00
Ivan Kylchik 91f68f0e17 Fix bug with wrong cast in CommonProxy 2023-01-27 10:52:56 +00:00
Ivan Kylchik bc21753877 Move IR interpreter's tests from ir/loweredIr directory into box 2023-01-27 10:52:56 +00:00
Ivan Kylchik 7d6bac64fb Extract JVM logic of AbstractIrInterpreterTest into separate class 2023-01-27 10:52:54 +00:00
Ivan Kylchik 13cad2a820 Don't save constant value for non-resolved array expression in K1
#KT-55912 Fixed
2023-01-27 09:56:35 +00:00
Yahor Berdnikau 8fcea399f9 Fix double call to get files from FileCollection
^KT-54588 Fixed
2023-01-27 09:29:16 +00:00
Yahor Berdnikau fda4ff177d Add missing javadoc and sources jar publication
That was missed during 92509ad400 on
adding commit.
2023-01-27 09:22:03 +00:00
Anna Kozlova e5b96561e0 [FIR] skip implicit call to enum constructor if super type call exists
otherwise, reference to the super type would be resolved even when it's not
e.g. for interface constructor
^ KTIJ-24437
2023-01-27 08:20:07 +00:00
Aleksei.Cherepanov 07d369998c [Maven] Add test for the fix of illegal reflective access while using jdk17
IJ-203 dependency has illegal reflective access usage, which is prohibited without a special flag since JDK17. Specific reflect usage was fixed on the IntelliJ side (IDEA-31024). After the new IC was present in 1.8.0, this problem shows up on modules with a large number of source files in Maven projects. During the incremental compilation, FileSnapshotMap is filled up with paths to files as keys, so in the test, we generate a lot of source files with long names. If there are a lot of files to compile, a key chunk with paths overflowed and drops the current chunk to the disk, after that PersistentHashMap caches FilterOutputStream and uses illegal reflective access.
Closing caches after the first IC attempt fix this problem:
`63a0660c` IC: Close caches before falling back to non-incremental compile
`908dbf32` IC: Clean up closing caches logic in IncrementalCompilerRunner.kt
authored by Hung Nguyen
This commit should be reverted after the update of IJ dependency (KT-47765)

#KT-55709 Fixed

Merge-request: KT-MR-8359
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-01-27 07:26:17 +00:00
Ilya Gorbunov b558382f17 Cleanup unneeded options in kotlin-stdlib-jdk7/8 compilations 2023-01-26 20:57:00 +00:00
Ilya Gorbunov 5a4eb22961 Move isolated addSuppressed extension test to jvm tests
Conditions for being isolated do not hold anymore:
it tested that addSuppressed extension could work without kotlin-stdlib-jdk7,
but now the latter is merged to kotlin-stdlib and thus always present

#KT-51907
2023-01-26 20:57:00 +00:00
Ilya Gorbunov 8b68234528 Include all jvm stdlib tests into kotlin-stdlib project test
JVM stdlib tests are compiled against JDK 8 so there's no need to divide them by modules anymore

#KT-51907
2023-01-26 20:57:00 +00:00
Ilya Gorbunov 72ced53833 Fix dependencies between stdlib main source sets KT-51907
Otherwise mainJdk7/8 source sets don't see symbols from main when imported to IDEA
2023-01-26 20:56:59 +00:00
Anton Lakotka ba20972449 [Gradle] Clone Properties before iterating over them as it can cause...
...ConcurrentModificationException if someone will concurrently
 modify them
2023-01-26 16:01:37 +00:00
Sergey Bogolepov f5d4984274 Update HACKING.md 2023-01-26 17:49:06 +02:00
Sebastian Sellmair 294014a85d [Gradle][Minor] KotlinTargetHierarchyDsl: Fix doc pointing to old function
KT-56204
2023-01-26 15:37:23 +00:00
Sebastian Sellmair ca859c0132 [Gradle] KotlinTargetHierarchy: Change naming from 'any' to 'with' prefix
^KT-56204 Verification Pending
2023-01-26 15:37:23 +00:00
Mikhail Glukhikh 8aed6d3c4c K2: add dispatchReceiverForStatics to ScopeTowerLevel to avoid receiver hacks
Related to KT-55116
2023-01-26 15:27:58 +00:00
Mikhail Glukhikh d436d56871 FE: add some more tests around static field fake overrides 2023-01-26 15:27:58 +00:00
Mikhail Glukhikh 938e1d5ce8 K2: copy explicit receiver to dispatch receiver for static member accesses
Related to KT-55116
2023-01-26 15:27:57 +00:00
Mikhail Glukhikh 4167a69e30 K2: generate implicit dispatch receivers for static members called
#KT-55371 Fixed
#KT-55372 Fixed
2023-01-26 15:27:57 +00:00
Mikhail Glukhikh 9cfcf057ef K2: expand qualifier type aliases in visibility checker & in FIR2IR
#KT-55408 Fixed
2023-01-26 15:27:56 +00:00
Mikhail Glukhikh ead319f832 K2: add test for KT-55408 2023-01-26 15:27:56 +00:00
Mikhail Glukhikh aafde418cc K2: store imported static qualifiers in dispatch receiver field
This is a partial revert of commit 104fd4c1
#KT-55116 Fixed
2023-01-26 15:27:55 +00:00
Mikhail Glukhikh 416d4f57eb K2: add test for KT-55371 2023-01-26 15:27:55 +00:00
Sergey Bogolepov c074cf6635 [K/N] Update HACKING.md to reflect -Xsave-llvm-ir-directory 2023-01-26 14:32:49 +00:00
Sergey Bogolepov b9a7921b10 [K/N] Remove obsolete todo message
Since we run ReturnsInsertionPhase on per-file basis,
prerequisites check is triggered only if modules has files.
2023-01-26 14:32:49 +00:00
Sergey Bogolepov 362cff892b [K/N] Code cleanup 2023-01-26 14:32:49 +00:00
Sergey Bogolepov 0b4db4beca [K/N] Fix ALL phases value 2023-01-26 14:32:48 +00:00
Sergey Bogolepov 9f4e086ff9 [K/N] Fix filecheck tests 2023-01-26 14:32:48 +00:00
Sergey Bogolepov 851d84a865 [K/N] Enable proper LLVM IR dump and verify actions
Also introduce -Xsave-llvm-ir-directory argument
that should be used instead of -Xtemporary-files-dir
as a location for LLVM IR from phases.
Motivation for this change: it is simpler to implement
and unties LLVM actions from the awful TempFiles class.
2023-01-26 14:32:48 +00:00
Sergey Bogolepov 0febffedbd [K/N] Add LlvmIrHolder adapter interface for debugging purposes
Similar to KotlinBackendIrHolder and BackendContextHolder interfaces.
2023-01-26 14:32:47 +00:00
Sergey Bogolepov 60ff50dc51 [K/N] Enable IR validation and dumping for more phases 2023-01-26 14:32:47 +00:00