Commit Graph

41846 Commits

Author SHA1 Message Date
Alexander Udalov d2b66e5004 IR: remove IrCallMatcher/IrFunctionMatcher and usages
There doesn't seem to be much value over a simple imperative code which
checks exactly the same things in the same order. The main downside of
the removed API is that it was more difficult to debug.
2022-12-28 14:06:57 +01:00
Alexander Udalov 18950b448c IR: simplify for-loop lowering internals a bit
Remove ExpressionHandler, HeaderInfoFromCallHandler, ProgressionHandler.
2022-12-28 14:06:57 +01:00
Pavel Mikhailovskii 906c161068 KT-52791 Make it possible to pass multiple context receivers to a class 2022-12-28 11:21:03 +00:00
Svyatoslav Kuzmich 62217b39ec [Wasm] Rename WasmImportPair -> WasmImportDescriptor 2022-12-28 12:14:16 +01:00
Svyatoslav Kuzmich dd53998c2d [Wasm] Add uninstantiated MJS wrapper
It allows

* Custom imports
* Ability to skip initializer
2022-12-28 12:13:52 +01:00
Svyatoslav Kuzmich 3bbd8c291a [Wasm] Add @WasmImport annotation
Imports top-level function from given module
2022-12-28 12:13:18 +01:00
Pavel Mikhailovskii 3704d54101 KT-52459 Handle context receivers when generating a bridge 2022-12-27 16:19:59 +00:00
Roman Efremov 25f65aff3a Replace getEntries with hardcoded PsiMethod in LC decompiled declaration
This adds NotNull annotation.

^KTIJ-23530 Fixed
2022-12-27 14:41:53 +00:00
Roman Efremov cbb20ce2b8 Don't generate getEntries method in light classes when feature disabled
^KTIJ-23530 Fixed
2022-12-27 14:41:53 +00:00
Roman Efremov e5d5cbc7a3 Generate Enum.getEntries method in ultra light classes
^KTIJ-23530 Fixed
2022-12-27 14:41:52 +00:00
Ilya Kirillov 396ac6f5e3 [FIR] make FirCorrespondingSupertypesCache to be thread safe
^KT-50244
2022-12-27 13:27:24 +00:00
Ilya Kirillov 4d7e9b2d5a [FIR] add possibility to specify initialCapacity and loadFactor in FirCachesFactory.createCache 2022-12-27 13:27:23 +00:00
Pavel Mikhailovskii 076bedd065 KT-51397 Add a test (has been fixed elsewhere) 2022-12-27 12:50:43 +00:00
Pavel Mikhailovskii 9ca5e1b421 KT-54357 Fix passing of context receivers to object literal constructors 2022-12-27 11:52:36 +00:00
Kevin Bourrillion 70cd547c26 Fix two other tests to treat both old and new JSpecify packages the same 2022-12-27 11:11:00 +00:00
Kevin Bourrillion 2694bdeb92 Change to use new JSpecify package location. 2022-12-27 11:10:59 +00:00
Kevin Bourrillion 671480ce1a Duplicate this entire test suite to jspecifyOld before changing the package locations in jspecify. 2022-12-27 11:10:59 +00:00
Kevin Bourrillion b69b7ab22d Make the jspecify test accept either (old & new) annotations. 2022-12-27 11:10:58 +00:00
Andrey Uskov 2be68065af Report lines number and LpS in build reports
#KT-55540 Fixed
2022-12-26 17:18:44 +03:00
Andrey Uskov f07f193938 Make line number field public in PerformanceMeasurement
Required for KT-55537
2022-12-26 17:16:02 +03:00
Yan Zhulanow d652dc620c [FE] Preserve legacy contract description calls in bodies
^KT-55231 Fixed
^KTIJ-21012 Fixed
2022-12-26 11:46:58 +00:00
Yan Zhulanow f067f64255 [FE] Extract common logic in consistency visitor and transformer 2022-12-26 11:46:58 +00:00
Ilya Gorbunov e2d96da396 Introduce experimental kotlin.concurrent.Volatile annotation KT-55268, KT-55609
Use this annotation in tests to ensure it works the same at least on JVM
2022-12-23 19:07:30 +01:00
Ilmir Usmanov 58d6d7b9ad Minor. Regenerate tests 2022-12-23 01:15:18 +00:00
xiaozihan.larryxiao 64d40aa285 KT-55398 Add test case
Add KT-55398 test case into boxInline/reified
2022-12-23 01:15:18 +00:00
xiaozihan.larryxiao 22a9b84966 KT-55398 Fix nested inline variable not correctly
^KT-55398 Fixed
Add nested variable's ReifiedTypeParametersUsages into closureReifiedMarkers for MethodInliner to generate nested inline anonymous class
2022-12-23 01:15:18 +00:00
Xin Wang 7278f9a4fd JVM Inline: Update tryCatchBlocks when expand mask conditions
Fixes: KT-48989
2022-12-22 12:50:41 +00:00
Evgeniy.Zhelenskiy 25db5bf6e1 [IR] Enable -Xvalue-classes flag
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-12-22 12:24:16 +00:00
Anna Kozlova 15b1e429d7 [compiler] introduce dedicated Fir declaration for dangling modifier lists (KTIJ-23008)
ensure fir annotations are included in FirDanglingModifierList and resolved,
dedicated DanglingTopLevelModifierListStructureElement exists for top
level lists only, class level lists are processed by containing structure
element
2022-12-21 20:58:46 +00:00
Svyatoslav Kuzmich d788adcbb5 [Wasm] Move non-recursive function types out of rec group
This fixes linking with other wasm modules with non-rec types
2022-12-21 20:20:13 +00:00
Dmitrii Gridin 88f1f74aec [ULC] fix descriptor leak from synthetic members
^KT-55604 Fixed
2022-12-21 19:08:56 +00:00
Dmitriy Novozhilov 1b16d651ae [FIR] Disambiguate names of files with helpers in spec tests
Test framework assumes that there won't be any files with same names
  in one test. But there were cases when test declared test file
  with same name as one of files with helpers (e.g. `functions.kt`)
2022-12-21 16:30:58 +00:00
Dmitriy Novozhilov 54a004ef1a [FIR] Fix behavior of FirCompilerLazyDeclarationResolverWithPhaseChecking in tests
1. There was an incorrect filtration of failures if FIR_DISABLE_LAZY_RESOLVE_CHECKS
    directive was present
2. `FirDumpHandler` potentially can call lazy resolution in presence of
    compiler plugins, so we should call `startResolvingPhase`/`finishResolvingPhase`
    in it before traversing the tree
2022-12-21 16:30:58 +00:00
Pavel Mikhailovskii 06d3e1d8bd KT-55005 Do not generate CHECKCAST before AASTORE 2022-12-21 15:06:07 +00:00
Ilya Chernikov baf90178ad K2 Scripting: fix resolution for scripts:
script should not be resolved on annotations args mapping resolve
2022-12-21 14:34:21 +00:00
Ilya Chernikov 00a28f9f49 K2 Scripting: compiler extension for script configuration 2022-12-21 14:34:20 +00:00
Ilya Chernikov a89dfdce03 K2 Scripting: add support for script args to FIR part 2022-12-21 14:34:20 +00:00
Ilya Chernikov 533a5671bc K2 Scripting, IR: add script receiver on conversion to class 2022-12-21 14:34:19 +00:00
Ilya Chernikov bc2aa20b86 Revert unrelated refactoring from "FIR: Fix interface delegation ABI"
the refactoring is questionable at places and breaks FirScript support
2022-12-21 14:34:19 +00:00
Dmitriy Novozhilov ce2880614b [FIR2IR] Run constant evaluation before IR extensions
Test `constValInSerialName` in serialization still fails but because of
  different reason

^KT-54994 Fixed
2022-12-21 11:09:30 +00:00
Dmitriy Novozhilov c44993e586 [FE] Use FQN instead of KClass in TypeRegistry
TypeRegistry is the static map which contains mapping between type of
  session component and its index in the session array. Originally
  `KClass` of a component was used as a key in this map, which worked
  pretty well for compiler components. But there was a problem with
  components from plugins and Kotlin daemon: in compilation with daemon
  we keep TypeRegistry between compilations. But for each compilation
  we load plugins from jar, which brings to the situation when after N
  compilations there is N entries in TypeRegistry map with different
  KClass'es for same extension component. This not only causes AIOBE
  but also introduces the memory leak, because we keep reference to
  KClass which is not used anymore

So to fix this issue it's enough to just store FQN of component in
  TypeRegistry instead of KClass

There are no tests in this commit, but they will be added in next
  commit relevant to scripting. With those commits we will have gradle
  integration tests which uses Kotlin compiler daemon and registers
  a compiler plugin for scripting

^KT-55023 Fixed
2022-12-21 10:33:03 +00:00
Mikhail Glukhikh fc95889115 Move isCompilingAgainstJdk8OrLater to JvmBackendContext
This should solve multi-thread synchronization problem
Probably #KT-55483 Fixed
2022-12-20 21:41:43 +00:00
Evgeniy.Zhelenskiy ac28c0a286 [IR] Allow inline modifier for functions returning MFVC without warning
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-12-20 21:26:56 +00:00
Pavel Kunyavskiy 4928e284f6 Make LateinitIntrinsicApplicabilityChecker warning for Native and JS
This checker was enabled only on JVM by mistake.
It's now fixed, but we don't want to make it an error in minor release.
So it will be an warning in 1.8.20 and an error in 1.9.0

^KT-27002
2022-12-20 20:06:52 +00:00
Pavel Kunyavskiy 17e9a6a781 [klib] Fix serialization of missing annotations
^KT-42490
^KT-44625
2022-12-20 20:06:51 +00:00
Dmitrii Gridin c77401d823 [SLC] drop redundant 'final' modifier from synthetic enum members
^KT-55502 Fixed
2022-12-20 19:52:14 +00:00
Dmitrii Gridin bb51d62e0a [SLC] support static properties (e.g. Enum.entries)
^KT-55496
^KTIJ-23530
2022-12-20 19:52:13 +00:00
Dmitrii Gridin e39dc9b768 [LC] fix signature of 'Enum.valueOf()'
* drop @NotNull annotation from parameter
* add NullPointerException to throws

^KT-55497 Fixed
2022-12-20 19:52:12 +00:00
Dmitrii Gridin 7d0c093da7 [SLC] generate static enum methods from symbols
^KT-55496 Fixed
2022-12-20 19:52:11 +00:00
Dmitrii Gridin c28e9d5253 [LC] add tests for enum classes
^KT-55496
^KTIJ-23530
2022-12-20 19:52:11 +00:00