Commit Graph

96600 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 6864433581 [FIR] Support resolution of meta-annotations before supertypes
Now annotations are resolved with following algorithm:
1. On COMPILER_REQUIRED_ANNOTATIONS we resolve all annotations
     and store results if this is compiler annotation, plugin annotation,
     or annotation with meta-annotation (meta annotations are checked
     recursively with designated resolution if needed)
2. On TYPES stage we resolve all those annotations once again and if
     some annotation changes resolution then we keep type from p.1 and
     report error on this annotation, so user should disambiguate it

Ambiguity may occur because of nested annotations with same name as
  plugin annotations:

```
annotation class SomeAnnotation // (1) plugin annotation

open class Base {
    annotation class SomeAnnotation // (2)
}

class Derived : Base() {
    @SomeAnnotation // <-----------------
    class Inner
}
```
At COMPILER_REQUIRED_ANNOTATIONS annotation call will be resolved to (1)
  because at this stage supertypes are not resolved yet, and we consider
  only importing scopes. At the TYPES stage we will find correct
  annotation from supertype
2022-12-01 07:29:39 +00:00
Dmitriy Novozhilov 6a9b525ca0 [Serialization] Fix dependency on kotlin-reflect 2022-12-01 07:29:38 +00:00
Dmitriy Novozhilov aaf0a1f396 [FIR] Introduce shouldNotBeCalled utility function 2022-12-01 07:29:38 +00:00
Dmitriy Novozhilov 0b4216c096 [FIR] Fix test configuration of FIR plugin prototype 2022-12-01 07:29:38 +00:00
Dmitriy Novozhilov 8436328bb5 [ImportsDumper] Fix path replacements in tests on Windows 2022-12-01 07:29:37 +00:00
Dmitriy Novozhilov 6b343515e1 [Test] Save IR bytecode dumps from BytecodeListingHandler to .ir.txt file instead of _ir.txt
This is needed to keep consistency with other dumps and to allow
  test helper plugin to recognize those dumps
2022-12-01 07:29:37 +00:00
Dmitriy Novozhilov 246dc985a6 [FIR] Rework predicates system
Now predicates are split into LookupPredicate and DeclarationPredicate
  hierarchies. First one allows to perform global search for declarations
  and second one allows to check if some declaration matches the predicate.
Predicates with meta annotations are excluded from LookupPredicates,
  because it's impossible to create index of annotations with meta-annotations,
  because they can be located inside binary dependencies (so to achieve
  this we need to scan the whole classpath).
Also only one predicate with meta-annotations is left in DeclarationPredicate
  hierarchy (AnnotatedWithMeta)

^KT-53874 Fixed
^KT-53590 Fixed
2022-12-01 07:29:37 +00:00
Dmitriy Novozhilov 7a9a71a089 [ImportsDumper] Add missing test runtime dependencies 2022-12-01 07:29:36 +00:00
Dmitriy Novozhilov 2610ad94e0 [SamWithReceiver] Fix test configuration and testdata 2022-12-01 07:29:36 +00:00
Dmitriy Novozhilov ebc879ed1e [AllOpen] Update testdata 2022-12-01 07:29:36 +00:00
Dmitriy Novozhilov dff5799c58 [Test] Don't create separate .fir.txt file in BytecodeListingHandler if not necessary 2022-12-01 07:29:35 +00:00
Dmitriy Novozhilov 700a117476 [Build] Add forgotten compiler plugins tests to aggregate build 2022-12-01 07:29:35 +00:00
Alexander Udalov 25c5ad176c Minor, update instructions for installing protobuf261 + regenerate 2022-12-01 01:37:55 +01:00
Simon Ogorodnik 16476dec61 Owners. Make Evolution Team responsible for LanguageVersionSettings 2022-11-30 21:53:33 +00:00
Artem Daugel-Dauge 30c2c62a1b Properly specify outputs for PodGenTask + expose Podfile location 2022-11-30 21:19:14 +00:00
Pavel Mikhailovskii f96d41e414 KT-4107 Don't generate readResolve for data objects 2022-11-30 21:07:20 +00:00
Marco Pennekamp ea346e3e0e [AA] Rename originalOverriddenSymbol to unwrapFakeOverrides
- `unwrap` signals that fake overrides will be unwrapped until the
  original symbol is recovered.
- Also remove nullability of the returned `KtCallableSymbol`. If the
  given symbol cannot be unwrapped, it is most likely already the
  original symbol.
- Remove the lazy resolve to `STATUS` in `KtFirOverrideInfoProvider`, as
  it's not needed to unwrap fake overrides.
2022-11-30 19:49:14 +00:00
Evgeniy.Zhelenskiy fa4a4e56f3 [Tests] Remove unnecessary usages of OPTIONAL_JVM_INLINE_ANNOTATION
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:42 +00:00
Evgeniy.Zhelenskiy 50310d42e3 [IR] MFVC lateinit variables and properties test
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:42 +00:00
Evgeniy.Zhelenskiy b7f249cdb6 [IR] Fix bugs in MFVC function references support
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:41 +00:00
Evgeniy.Zhelenskiy 86809e898a [IR] Combine value class lowerings
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:41 +00:00
Evgeniy.Zhelenskiy 68fb8aa2a1 [IR] Replace indexes with names for mfvc methods and fields
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:41 +00:00
Evgeniy.Zhelenskiy b692748938 [IR] Always add getter methods to value classes even if not used
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:40 +00:00
Evgeniy.Zhelenskiy 3653c86f08 [IR] Rename static replacement of MFVC typed equals to "equals-impl0"
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:40 +00:00
Evgeniy.Zhelenskiy 38c80192f9 [IR] Support MFVC-typed properties and interfaces delegates
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:40 +00:00
Evgeniy.Zhelenskiy 4d426fc4cd [IR] Generate not FIR_IDENTICAL box fir value classes tests
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:39 +00:00
Evgeniy.Zhelenskiy fa4ceb4ef4 [IR] Add diagnostics to forbid annotations for MFVC-typed elements
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:39 +00:00
Evgeniy.Zhelenskiy adee33d3e5 [IR] Forbid MFVC primary constructors default arguments
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:38 +00:00
Evgeniy.Zhelenskiy c6e54e6433 [IR] Support object-like interaction with MFVC function references
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:37 +00:00
Evgeniy.Zhelenskiy 1660dc21b9 [IR] Refactor optimization of eliminating removing extra boxes
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:37 +00:00
Evgeniy.Zhelenskiy f2d98eac5e [IR] Make use a temp variable for flattened non-local non-MFVC getters
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:37 +00:00
Evgeniy.Zhelenskiy 9f01ccc304 [IR] Support user-defined equals for MFVC
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:36 +00:00
Evgeniy.Zhelenskiy 51f9f31a0a [IR] Remove suffix from MFVC specialized equals function
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:36 +00:00
Evgeniy.Zhelenskiy 6107caa8e2 [FE1.0, FIR] Support secondary constructors for Value Classes
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:35 +00:00
Evgeniy.Zhelenskiy 8c3fa6f09f [IR] Escape removing extra boxes if no box was are in the function
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:35 +00:00
Evgeniy.Zhelenskiy 962265531e [IR] Weaken pressure on Local storage to fix performance issue
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:35 +00:00
Evgeniy.Zhelenskiy 89d5592622 [IR] Support function references
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:34 +00:00
Evgeniy.Zhelenskiy b45f2baff5 [IR] Fix performance regression
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:34 +00:00
Evgeniy.Zhelenskiy 51e76aa19a [IR] Support default arguments
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:33 +00:00
Evgeniy.Zhelenskiy 0c70b60988 [IR] Add context receiver test on MFVC
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:33 +00:00
Dmitrii Gridin fe1647096f [SLC] cleanup 'equals' code
^KT-54051
2022-11-30 12:59:12 +00:00
Dmitrii Gridin 2329bd1fe7 [SLC] SymbolLightAccessorMethod: simplify equals for psi case
^KT-54051
2022-11-30 12:59:12 +00:00
Dmitriy Novozhilov 5c3af11188 Advance bootstrap to 1.8.20-dev-3308 2022-11-30 12:25:20 +00:00
Artem Kobzar 67048151fb [K/JS] Change js-call inlining strategy and + ability to referencethis safely from the js call ^Fixed KT-54134 2022-11-30 11:43:22 +00:00
Sergey Bogolepov b1f2f733fe [K/N] Enable dynamic driver for klib output by default 2022-11-30 11:24:41 +00:00
Sergey Bogolepov 39656209f0 [K/N] Enable klib IR phases in dynamic driver
Support SpecialBackendChecksPhase and CopyDefaultValuesToActualPhase
2022-11-30 11:24:41 +00:00
Sergey Bogolepov 73a52b6081 [K/N] Support CompilerOutputKind.LIBRARY in the dynamic driver 2022-11-30 11:24:40 +00:00
Sergey Bogolepov b828672a2e [K/N] Untie PsiToIr phase from Context 2022-11-30 11:24:40 +00:00
Sergey Bogolepov 182662f7ed [K/N] A proper FrontendPhase
Rewrite frontend compiler phase using the new machinery.
As a side effect, some lateinit context properties are not lazy anymore.
2022-11-30 11:24:39 +00:00
Sergey Bogolepov 4bae6d794c [K/N] Introduce PhaseEngine and PhaseContext
These two classes represents a core of a new dynamic K/N driver.
2022-11-30 11:24:39 +00:00