Commit Graph

32434 Commits

Author SHA1 Message Date
Alexander Gorshenev eea5a9102c Bump klib abi version to 1.4.2 to reflect absence of serialized fake overrides 2020-11-09 16:02:14 +03:00
Alexander Gorshenev cb288d47ea Don't serialize fake overrides anymore 2020-11-09 16:02:14 +03:00
Alexander Gorshenev 5de7a10df0 Eliminated -Xdeserialize-fake-overrides 2020-11-09 16:02:14 +03:00
Dmitry Petrov b9c6267a63 KT-43217 Encode @EnhancedNullability types in IdSignature 2020-11-09 15:20:46 +03:00
Igor Chevdar 5e0f54a30b [IR] Fixed https://youtrack.jetbrains.com/issue/KT-43159 2020-11-09 11:37:37 +05:00
Pavel Kirpichenkov 0e8cf58a35 Minor: reformat 2020-11-08 15:33:30 +03:00
Pavel Kirpichenkov b79b94fe75 [MPP] Allow smart casts for properties from dependsOn modules
Smartcasts for public properties from different module are not
stable because module declaring a property in general can be
compiled separately from the module using it. However, if client
module has dependsOn relation with declaring module their simultaneous
compilation is guaranteed which makes this smart cast safe.

Cache all transitive 'expected by' modules in module dependencies.
Extend test to check smart casts are allowed for properties from transitive
'expected by' dependencies and prohibited otherwise.

^KT-42754 Fixed
2020-11-08 15:33:30 +03:00
Alexander Udalov 9adc1a6e9b JVM IR: generate 'main' wrappers as non-final
To replicate bytecode generated by the old backend, and thus simplify
ABI comparison.
2020-11-06 19:27:53 +01:00
Alexander Udalov 791be7c2dc JVM IR: improve ABI of properties in multifile facades
When copying top level declarations from multifile parts to facades,
also copy corresponding properties. This allows to keep their
annotations, which are later used in codegen (for example, to generate
ACC_DEPRECATED on property accessors), and allows to get rid of the hack
where the JVM name of the property accessor was computed prematurely via
methodSignatureMapper.

Also, don't copy `$annotations` methods for non-const properties to
facades because the old backend only generates them in parts (which
might be a separate problem, see KT-27644).

 #KT-40262 Fixed
2020-11-06 19:27:53 +01:00
Alexander Udalov 55974b4eda JVM IR: do not generate InlineOnly property accessors in multifile facade
#KT-37007 Fixed
2020-11-06 19:27:53 +01:00
Alexander Udalov 500b1cfbd3 JVM IR: fix flags of $default methods in multi-file facades
Do not change origin of multifile class bridges to something else
because, as it turns out, there are numerous origin-specific checks in
the codegen that start to behave differently for multifile bridges.
Instead of the method-targeted origin MULTIFILE_BRIDGE, use new class
origin JVM_MULTIFILE_CLASS to detect whether a declaration is a
multifile bridge.

 #KT-40198 Fixed
 #KT-43145 Fixed
2020-11-06 19:27:52 +01:00
Alexander Udalov bdb8a58b3b JVM IR: merge JvmBackendFacade into JvmIrCodegenFactory 2020-11-06 19:27:08 +01:00
Alexander Udalov 5c2c2591a1 Minor, rename file to keep git history 2020-11-06 19:27:07 +01:00
Alexander Udalov 624204c7b4 JVM IR: remove outdated code in JvmIrCodegenFactory 2020-11-06 19:27:07 +01:00
Alexander Udalov c1a292b01b Psi2ir: improve exception stack traces
- Do not wrap exceptions resulting from generating error expressions
  multiple times, as that could lead to stack traces where the identical
  code is wrapped many times and is printed in the exception message on
  each step, which was difficult to read
- Add element location (file name, line number & position) to the
  message, similarly to exceptions from codegen, when catching and
  rethrowing exceptions at the top level
2020-11-06 19:26:48 +01:00
Alexander Gorshenev 5f2a963006 Better wording and comments for klib compatibility code 2020-11-06 16:19:43 +03:00
Alexander Gorshenev 891a4c4621 Dropped outdated klib version compatibility mechanisms 2020-11-06 16:19:43 +03:00
Alexander Gorshenev 8b2b36d61f Enabled klib abi version compatibility 2020-11-06 16:19:42 +03:00
Denis Zharkov e434a1c892 FIR: Drop unused AbstractFirOverrideScope::create*Copy 2020-11-06 14:44:29 +03:00
Denis Zharkov 2e4c41c0d8 FIR: Drop PossiblyFirFakeOverrideSymbol 2020-11-06 14:44:28 +03:00
Denis Zharkov 7b48625b58 FIR: Remove FirCallableSymbol::overriddenSymbol 2020-11-06 14:44:27 +03:00
Denis Zharkov 78b374ec88 FIR: Do not set overriddenSymbol for KFunction::invoke
It has been probably set by mistake since overriddenSymbol is only used for
fake overrides
2020-11-06 11:32:39 +03:00
Denis Zharkov a11b488c82 FIR: Add workaround for combination of intersection + delegated members
See org.jetbrains.kotlin.fir.Fir2IrTextTestGenerated.FirProblems#testDelegationAndInheritanceFromJava
2020-11-06 11:32:39 +03:00
Denis Zharkov 41f878e104 FIR: Adjust test data for type alias constructors
They are not SubstitutionOverrides anymore
2020-11-06 11:32:39 +03:00
Denis Zharkov 96c3436e73 FIR: Temporary adjust diagnostics test data
UPPER_BOUND_VIOLATED for type alias constructors is not supported properly
See KT-43142
2020-11-06 11:32:39 +03:00
Denis Zharkov d58e66e79a FIR: Merge both synthetic type alias constructor kinds 2020-11-06 11:32:39 +03:00
Denis Zharkov f9aab77ce5 FIR: Simplify ConstructorProcessing relevant to type aliases 2020-11-06 11:32:39 +03:00
Denis Zharkov 8a949b0dcf FIR: Use attribute instead of overriddenSymbol for synthetic type alias constructor 2020-11-06 11:32:39 +03:00
Denis Zharkov 4282e27d73 FIR: Get rid of usages of FirCallableSymbol::overriddenSymbol 2020-11-06 11:32:39 +03:00
Denis Zharkov 728c2a808f FIR: Do not propagate overriddenSymbol at FirObjectImportedCallableScope 2020-11-06 11:32:39 +03:00
Denis Zharkov 037ba4d973 FIR: Simplify VariableStorage::isStable 2020-11-06 11:32:39 +03:00
Denis Zharkov 317d981472 FIR: Do not use overriddenSymbol for imported from object 2020-11-06 11:32:39 +03:00
Denis Zharkov 65119adb6a FIR: Adjust test data. FakeOverride -> SubssitutionOverride 2020-11-06 11:32:39 +03:00
Denis Zharkov 3e37995004 FIR: Get rid of FirCallableSymbol::isFakeOverride and isIntersectionOverride 2020-11-06 11:32:39 +03:00
Alexey Tsvetkov 36387d97ad Add IC metrics reporting 2020-11-05 23:26:46 +03:00
Alexey Tsvetkov 5bde6457b1 Metrics reporting utils 2020-11-05 23:26:46 +03:00
Alexey Tsvetkov 97a09680d5 Remove CompositeICReporterAsync 2020-11-05 23:26:42 +03:00
Zalim Bashorov 2c1e4c1769 [IR] Use more specific type (IrSimpleFunction) for accessors in IrLocalDelegatedProperty 2020-11-05 22:25:05 +03:00
Roman Artemev 8ca9e792e9 [KLIB] Make sure that referenced local anonymous class is deserialzied.
In case if such class is used an type argument for field type make sure
that field initializer is being read.

Check type recursively.

- fix KT-41143
- update test
2020-11-05 20:28:11 +03:00
Victor Petukhov 90ea64a0e5 Don't report warning about changing execution order for varargs if it's inside an annotation
^KT-43110 Fixed
2020-11-05 13:18:00 +03:00
Victor Petukhov f052bc341c Don't report warning about implicitly inferred Nothing for call arguments if there is non-Nothing return type
^KT-43108 Fixed
2020-11-05 13:17:59 +03:00
Jinseong Jeon b3b09ea9b7 FIR: adjust spec testData after DFA changes:
* recording type statements for null assignments
* element-wise join by default
2020-11-04 16:35:42 +03:00
Jinseong Jeon a5389b067b FIR DFA: use element-wise join everywhere 2020-11-04 16:35:42 +03:00
Jinseong Jeon 771c839d74 FIR DFA: element-wise join at merging points of try expression 2020-11-04 16:35:42 +03:00
Jinseong Jeon bd173ebebc FIR DFA: isolate effects between blocks in try expression 2020-11-04 16:35:42 +03:00
Jinseong Jeon 1f1e1828a7 FIR CFG: reconfigure exception throwing paths in try expression 2020-11-04 16:35:42 +03:00
Jinseong Jeon 146036010c FIR DFA: add tests about smartcasts in/after try-catch-finally 2020-11-04 16:35:42 +03:00
Mads Ager 2c8c47399a [JVM_IR] Enable KotlinAgainstJava and remaining JavaAgainstKotlin test. 2020-11-04 14:16:37 +01:00
Yunir Salimzyanov 24345bb6b3 Prevent NPE while fetching muted tests from Teamcity server 2020-11-04 16:14:01 +03:00
Mads Ager 0279068214 [JVM_IR] Follow old backend in bridge visibility and varargs marking.
The old backend makes bridges for protected and package-private
methods public. Also, for bridges for vararg methods, the vararg
marker is not on the bridge.

These differences seem minor but are visible via reflection, so
we might as well follow the old backend.
2020-11-04 12:03:06 +01:00