Commit Graph

72428 Commits

Author SHA1 Message Date
Pavel Kirpichenkov 9f7d7e55da Consider platform compatibility in library usage index
Logic of module dependencies is enhanced to filter out incompatible
common -> platform dependencies. However the reversed index for getting
all modules that use libraries doesn't take this filtering into
account and returns all modules based exclusively on order entries.
This leads to incorrect library dependency calculation.

^KT-44638 Verification pending
2021-02-05 16:36:59 +03:00
Dmitriy Dolovov 27dcd07a5e [Commonizer] Remove filter for simd_ functions (no more relevant) 2021-02-05 15:56:33 +03:00
Dmitriy Dolovov 4d5ec6e52a [Commonizer] Minor. Rename: builders.kt -> entityBuilders.kt 2021-02-05 15:56:28 +03:00
Dmitriy Dolovov 955f86ef9f [Commonizer] Minor. Rename: buildingVisitor.kt -> metadataBuilder.kt 2021-02-05 15:56:23 +03:00
Dmitriy Dolovov 33c1ca01f4 [Commonizer] Simplify creation of SerializedMetadataLibraryProvider 2021-02-05 15:56:17 +03:00
Dmitriy Dolovov 6c92ea518b [Commonizer] Add ModulesProvider.loadModuleMetadata() to load raw metadata 2021-02-05 15:56:12 +03:00
Dmitriy Dolovov cb226e74a5 [Commonizer] Refactor ModulesProvider.loadModuleInfos() function
Change return type from Map<String, ModuleInfo> to Collection<ModuleInfo>
2021-02-05 15:56:06 +03:00
Andrey Zinovyev 08111031ec [KAPT] Keep annotations from kotlin.jvm. in stubs
^KT-35104 Fixed
2021-02-05 13:41:46 +03:00
Mikhail Glukhikh a68837451a FirCatchParameterChecker: minor fix 2021-02-05 10:46:42 +03:00
Yan Zhulanow 0d1f493b6c Remove unneeded artifacts for Kotlin IDE plugin 2021-02-05 15:53:39 +09:00
Mikhail Glukhikh f1ab5d1fbd FIR: introduce & use Throwable built-in type 2021-02-05 09:33:54 +03:00
Mikhail Glukhikh bbd1da7b71 Use reportOn in FirThrowableSubclassChecker & FirCatchParameterChecker 2021-02-05 09:27:01 +03:00
eugenpolytechnic a564f92eef FIR: introduce ThrowableSubclassChecker 2021-02-05 09:22:12 +03:00
Ilmir Usmanov cd189c0812 JVM_IR. Do not unbox Result in inline lambda
Since JVM_IR generates inline lambdas differently from old backend,
in this case, it generates them as normal functions.
Thus, there is no need to unbox the lambda argument.
 #KT-44671 Fixed
2021-02-04 20:22:20 +01:00
Alexander Udalov fb296b5b95 Do not create Array instance in kotlin-reflect where not necessary
Although the previous code of computing JVM internal name from a Class
instance was shorter, it led to unnecessary creation of array types,
which is less performant and makes configuration of kotlin-reflect for
GraalVM native-image more verbose.

Unfortunately I didn't succeed in writing a test for this, since
`Array.newInstance` calls a native method which doesn't record any trace
of it being called in the class loader: the resulting array type never
goes through findClass/loadClass, and is not visible via
findLoadedClass.

 #KT-44594 Fixed
2021-02-04 19:13:42 +01:00
Mikhael Bogdanov 35ec6b4f5c Run IR test on Test Codegen on different platforms 2021-02-04 18:53:06 +01:00
Nikolay Krasko d5deccd2e9 Fix GradleQuickFixTest
Started as a result of postponed jdk dispose
71e74497b5

CodeInsightTestFixtureImpl assertPointersAreDisposed is invoked before
actually removing pointers.

com.intellij.openapi.util.TraceableDisposable$DisposalException: 1708093728
	at com.intellij.openapi.util.TraceableDisposable.getStackTrace(TraceableDisposable.java:121)
	at com.intellij.openapi.vfs.impl.VirtualFilePointerTracker.assertPointersAreDisposed(VirtualFilePointerTracker.java:86)
	at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$tearDown$38(CodeInsightTestFixtureImpl.java:1281)
	at com.intellij.testFramework.RunAll.collectExceptions(RunAll.java:57)
	at com.intellij.testFramework.RunAll.runAll(RunAll.java:35)
	at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.tearDown(CodeInsightTestFixtureImpl.java:1234)
	at org.jetbrains.kotlin.idea.codeInsight.gradle.GradleQuickFixTest.tearDownFixtures(GradleQuickFixTest.kt:41)
	at org.jetbrains.kotlin.idea.codeInsight.gradle.ExternalSystemTestCase.lambda$null$5(ExternalSystemTestCase.java:185)
2021-02-04 18:14:14 +03:00
Andrey Zinovyev dacf012a78 [KAPT] Add newline after each java compiler log (#4087)
^KT-27123 Fixed
2021-02-04 17:29:13 +03:00
Svyatoslav Kuzmich cdb488149f [JS IR] Namer improvements
- Compute and store local names locally when translating a body.
  It is a step towards separate JS generation and hopefully reduces memory usage.

- Use stable mangled names for member names. Needed for separate JS generation.

- Add `abstract class IrNamerBase` with just 3 abstract methods to simplify
  creating new IrNamer implementations.

- Fix O(N^2) of findFreshName when it is called wtih the same name suggestion a lot of times.

- Refactor NameTables initialisation: factor out some functions and use descriptive names.

- Use StringBuilder in sanitizeName
2021-02-04 16:17:01 +03:00
Svyatoslav Kuzmich c9cb7bc0fd [JS IR] Update tests 2021-02-04 16:16:41 +03:00
Svyatoslav Kuzmich ae738e9c59 [JS] Add basic optional logs to test runner 2021-02-04 16:16:21 +03:00
Svyatoslav Kuzmich c6242ad167 [JS] String.isValidES5Identifier
- Check Latin letters and numbers first before doing more expensive Character.getType
2021-02-04 16:16:21 +03:00
Svyatoslav Kuzmich 8be7e6064e [JS IR] Optimize sanitization
- Use direct function call instead of lambda
- Don't do anything for already valid names
2021-02-04 16:16:00 +03:00
Svyatoslav Kuzmich 2a424ad2af [IR] Make isExternal mutable and accessible via common interface
JS IR: Mark all effectively external declarations as external to access it
directly instead of computing it every time
2021-02-04 16:15:33 +03:00
Svyatoslav Kuzmich 924a7b009b [JS IR] Fix object getInstance visibility 2021-02-04 15:41:22 +03:00
Svyatoslav Kuzmich 218c246111 [JS] Fix extra js function capturing 2021-02-04 15:41:21 +03:00
Andrey Zinovyev 95140f35f8 [parcelize] Fix codegen for generic classes
Replace type arguments with star projection in static methods
Fix IR function generation

^KT-42652  Fixed
2021-02-04 15:11:51 +03:00
Dmitriy Novozhilov ca02573d1e [Test] Print bytecode if DxCheckerHandler had failed 2021-02-04 10:53:50 +03:00
Dmitriy Novozhilov 771b1acbc1 [Test] Ignore multimodule tests in AbstractLightAnalysisModeTest 2021-02-04 10:53:50 +03:00
Dmitriy Novozhilov 29b96aa15d [Test] Properly merge box against java testdata into codegen/box
Previous commit about it was 3199ce03 and it was completely wrong
2021-02-04 10:53:50 +03:00
Dmitriy Novozhilov 21c493a854 [Test] Support different backends enumeration in DONT_TARGET_EXACT_BACKEND directive 2021-02-04 10:53:49 +03:00
Alexander Udalov acd8c4503b Do not generate $suspendImpl for JvmDefault functions in interfaces
#KT-44533 Fixed
2021-02-03 21:37:58 +01:00
Ilmir Usmanov 5f71cd5476 Minor. Mute test on FIR 2021-02-03 19:18:29 +01:00
Ilmir Usmanov 02f845636e JVM_IR: Box generic Result parameter in suspend lambda
#KT-44527 Fixed
2021-02-03 19:18:27 +01:00
Ilmir Usmanov a30a961cf5 Minor. Throw exceptions in test coroutine builders 2021-02-03 19:18:24 +01:00
Dmitriy Dolovov 52e22796e1 [Commonizer] Prettier message about target with no libraries inside 2021-02-03 20:42:57 +03:00
Dmitriy Dolovov 73113c1041 [Commonizer] Dump every module to disk immediately when it's ready
No need to retain all metadata modules in memory -> lesser memory consumption.
2021-02-03 20:42:50 +03:00
Svyatoslav Kuzmich 53204661e3 [JS] Update stdlib API test data after dukat update 2021-02-03 20:36:24 +03:00
Svyatoslav Kuzmich d3b4df7da8 [JS] Revert paramter names changed by dukat 2021-02-03 20:36:24 +03:00
Victor Turansky f1682cba13 KT-40235 Dukat 0.5.8-rc.4 2021-02-03 20:36:24 +03:00
Victor Turansky ba0d60853d KT-40235 null companion for stdlib external union types 2021-02-03 20:36:24 +03:00
Victor Turansky 7523a5e97f KT-40235 Fix external interface companion support 2021-02-03 20:36:24 +03:00
Ilya Gorbunov cc55580300 Exclude kotlin-test root project during JPS sync 2021-02-03 19:28:42 +03:00
yaroslav.chernyshev b32db1ac02 Refactoring: change assertion signature, proper source set copying way 2021-02-03 19:15:33 +03:00
yaroslav.chernyshev b2017a9c9c Introduce importing checkers with implementation for orphan source sets
* Found diagnostics are attaching to the model
* Diagnostics are collecting into Module's DataNode on IDE side
* Some tests for diagnostics are added
2021-02-03 19:15:33 +03:00
Ilya Gorbunov 87e130e77a Remove obsolete diagnostics suppression
The diagnostic NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS is now
obsolete because internal constructors of inline classes became allowed.
2021-02-03 18:23:53 +03:00
Dmitriy Novozhilov ebced14db2 [FIR] Implement suppressing diagnostics with @Suppress 2021-02-03 18:10:48 +03:00
Dmitriy Novozhilov 459a2886a0 [FIR] Add CheckerContext to DiagnosticReporter and refactor diagnostic reporting
Refactoring includes replacing `Diagnostic.report` extensions in
  checkers with `DiagnosticReporter.reportOn` extension declared
  in DiagnosticReporter.kt
2021-02-03 18:10:48 +03:00
Andrey Zinovyev 923a4427c5 [KAPT] Fix stub generation for anonymous delegates
Replace anonymous classes with superclass in delegate properties
#KT-34838 Fixed
2021-02-03 17:27:41 +03:00
Alexander Udalov 60a05dded0 Build: fix default value for kotlin.build.disable.werror 2021-02-03 15:06:20 +01:00