Commit Graph

39129 Commits

Author SHA1 Message Date
Igor Yakovlev 0acb1c0c05 [WASM] Implemented Wasm unhandled exceptions on JS site 2022-02-03 21:25:57 +01:00
Igor Yakovlev e32f9eb2ce [WASM] throwableExtensions implementation 2022-02-03 21:25:57 +01:00
Ilya Goncharov a2167200d6 [JS IR] IR module to name
Merge-request: KT-MR-5672
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
2022-02-03 17:28:46 +00:00
Mikhail Glukhikh 11bbd79c4b FIR: replace ConeKotlinType with more concrete type when possible 2022-02-03 19:12:18 +03:00
Mikhail Glukhikh 27d4c745cb ConeSimpleKotlinType: introduce & use unwrapDefinitelyNotNull 2022-02-03 19:12:17 +03:00
Mikhail Glukhikh d1194e5fd2 FIR: drop some usages of ConeTypeContext 2022-02-03 19:12:17 +03:00
Mikhail Glukhikh 81ff9b820a FIR: make ConeSimpleKotlinType the only original for definitely not-null 2022-02-03 19:12:16 +03:00
Alexander Udalov 9826172720 CLI: support "arg=value" for argument's deprecatedName
#KT-51093 Fixed
2022-02-03 16:23:12 +01:00
Igor Laevsky 4e84e14d34 [Wasm] Don't squish modules together 2022-02-03 18:19:30 +03:00
Xin Wang fdbcb64d39 JVM_IR: frame optimization for cast to IntProgression
#KT-29199
2022-02-03 17:45:06 +03:00
Mikhael Bogdanov 15e08893aa FIR: support DefinitelyNotNull types
#KT-49465 Fixed
2022-02-03 14:07:20 +01:00
Mikhail Glukhikh bd31cbaebf Unmute some FIR2IR tests 2022-02-03 15:03:33 +03:00
Alexander Udalov 6379fe4c4c JVM IR: link via descriptors instead of signatures by default
Doing so speeds up psi2ir ~2 times, and thus improves total compiler
performance by about 6-8%.

Unless JVM IR is in the mode where linking via signatures is the only
way (-Xserialize-ir, -Xklib), signatures are actually not needed at all,
SymbolTable can use the frontend representation (descriptors for FE1.0,
and hopefully FIR elements for K2) as hash table keys. The only catch is
that since other backends still need to work with signatures, all the
common IR utilities, such as irTypePredicates.kt, need to work correctly
for IR elements both with signatures and without.

Also, introduce a fallback compiler flag -Xlink-via-signatures, in case
something goes wrong, to be able to troubleshoot and workaround any
issues.

 #KT-48233
2022-02-03 02:48:05 +01:00
Alexander Udalov 6e4131de8e IR: improve toString for symbols 2022-02-03 02:48:05 +01:00
Kristoffer Andersen cd118e4723 [EE-IR] Minor: Generate valid bytecode for Fragment Class in PSI2IR
Testing revealed buggy generation of classes: the prior code is
rejected by the JVM verifier due to missing call to `this()` or
`super()`.
2022-02-02 23:45:41 +01:00
Igor Chevdar c0715cfb0c [K/N][IR][caches] Fixed problems with inline classes
Fixes https://youtrack.jetbrains.com/issue/KT-50978
2022-02-02 22:46:16 +05:00
Igor Chevdar 949e222305 [IR] Fixed a problem with signature search
The function findDescriptorBySignature should return null if no such signature has been found
letting the caller to handle this correctly. Fixes https://youtrack.jetbrains.com/issue/KT-50976
2022-02-02 22:46:16 +05:00
Igor Yakovlev 0ae7e00ed8 Revert "[WASM] Remove ignore from passing tests"
This reverts commit a655f9da58.
2022-02-02 16:44:48 +03:00
Igor Yakovlev 1446914ba9 [WASM] Run box tests with dce and non-dce modes 2022-02-02 16:44:47 +03:00
Dmitriy Novozhilov c23624380e [FE 1.0] Enable StopPropagatingDeprecationThroughOverrides in progressive mode
^KT-47902
2022-02-02 15:07:44 +03:00
Dmitry Petrov bbad3e9e94 JVM collect additional performance metrics in FE1.0 + JVM_IR pipeline 2022-02-02 11:56:01 +00:00
Dmitriy Novozhilov e544c404b9 [FIR] Fix error message for CONFLICTING_INHERITED_MEMBERS 2022-02-02 10:55:40 +03:00
Dmitriy Novozhilov ee1a842b6c [FIR] Fix error message for LEAKED_IN_PLACE_LAMBDA 2022-02-02 10:52:54 +03:00
Jinseong Jeon 71c60ce9d0 FIR2IR: fix type of delegating constructor call 2022-02-01 19:15:25 +03:00
Mikhail Glukhikh 029e946fb2 FIR: report VAL_REASSIGNMENT on synthetic immutable properties
#KT-50972 Fixed
2022-02-01 18:48:50 +03:00
Denis.Zharkov adb9dfb256 FIR: Rework processing AugmentedArraySetCall
Previously (few commits earlier), it contained two versions
of receiver (lhs) generated separately for each desugaring version
that looked a bit redundant.

Now, at FIR building stage we just don't create desugaring sub-trees,
instead they are being built during bodies transformation and that seems
to be much convenient there, since we don't need to reverse-engineer
get-set-operator version to check if containing calls are successful
(as we just built those calls and retain them)

Semantically, this changes may only change how data flow works
for such statements (see changed compatibilityResolveWithVarargAndOperatorCall.kt)

^KT-50861 Relates
2022-02-01 13:12:49 +03:00
Denis.Zharkov 772579143b FIR: Change semantics for combination of safe calls and operators
^KT-41034 Fixed
2022-02-01 13:12:49 +03:00
Denis.Zharkov 0dd5042e62 FIR: Extract putIncrementOrDecrementStatements 2022-02-01 13:12:48 +03:00
Denis.Zharkov 32ba136366 FIR: Minor. Put variable closer to its usages 2022-02-01 13:12:47 +03:00
Denis.Zharkov e8581bdde5 FIR: Clarify parameter names in BaseFirBuilder.generateIncrementOr* 2022-02-01 13:12:46 +03:00
Denis.Zharkov 111b606580 FIR: Clarify contract for BaseFirBuilder.generateAssignment
^KT-50861 Relates
2022-02-01 13:12:45 +03:00
Denis.Zharkov 6f89f1ebf4 FIR: Allow selector of safe calls to be a FirStatement
It's necessary to allow a?.b += v be interpreted as a?.(b += v)
But currently FirAssignmentOperatorStatement is not FirQualifiedAccess

^KT-41034 In Progress
2022-02-01 13:12:45 +03:00
Hung Nguyen 1cb509d529 KT-45777: Remove proto-based approach to compute Java class snapshots
as the ASM-based approach is better, and we have switched to the
ASM-based approach for a while now.
2022-02-01 12:41:53 +03:00
Pavel Punegov f819a10968 [K/N][test] Ignore test with synchronized java keyword 2022-02-01 11:46:35 +03:00
Alexander Udalov 7dfe1793c8 Remove obsolete code used to load module annotations
`CliModuleAnnotationsResolver.getAnnotationsOnContainingModule` took
0.5% of total compilation time on IntelliJ.

 #KT-48233
2022-02-01 08:42:40 +01:00
Alexander Udalov d0f958d7a1 JVM IR: optimize isStaticInlineClassReplacementDelegatingCall
Static inline class replacements are possible only in inline classes.

Iterating over class declarations here took ~0.5% of backend time on
average projects, and up to 4% of total compilation time on degenerate
projects such as the one in KT-20055.
2022-02-01 08:42:39 +01:00
Mikhail Glukhikh 05d65275bf FIR u/s scope: choose most specific intersection member for override check
Before this commit we took just first intersection member for this check.
However it's quite bad, because we were dependent on supertype order.
Choosing the most specific member looks more consistent here.

#KT-50969 Fixed
2022-01-31 21:59:18 +03:00
Mikhail Glukhikh 1137e61fc8 FIR: add test for KT-50969 2022-01-31 21:59:15 +03:00
Hung Nguyen 37c6b1c2dc KT-45777: Track build time in nanoseconds instead of milliseconds
to ensure precision (otherwise, rounding errors to milliseconds may
add up and cause unexplainable gaps in the running time).

We can still use milliseconds in the final report after all the precise
sub-build-times have been aggregated.
2022-01-31 19:50:03 +03:00
Yahor Berdnikau 52a21a4e1a Remove 'noStdlib' from Gradle options
^KT-49011 Fixed
2022-01-31 17:28:13 +01:00
Yahor Berdnikau 57c342fec8 Remove 'noReflect' from Gradle options
^KT-49011 In Progress
2022-01-31 17:28:13 +01:00
Yahor Berdnikau 27e449cd56 Remove 'useIR' from Gradle options
^KT-49011 In Progress
2022-01-31 17:28:13 +01:00
Yahor Berdnikau 8ffe78dba4 Remove GradleOption from 'includeRuntime' argument
^KT-49011 In Progress
2022-01-31 17:28:13 +01:00
Yahor Berdnikau c019dbce47 Rename DeprecatedOption into GradleDeprecatedOption
This should make it more explicit

^KT-49011 In Progress
2022-01-31 17:28:13 +01:00
Dmitry Petrov beb4cf3d99 PSI2IR KT-51036 fix lambda return value generation 2022-01-31 12:18:19 +00:00
Ilya Goncharov 32cda8a37e [JS IR] Fix cache format, module name one the second line 2022-01-31 12:00:12 +00:00
Alexander Korepanov 769fbcf3d0 [JS IR] Improve performance for runtime typecheck
This is a part of KT-42743
2022-01-31 09:15:58 +00:00
Vladimir Dolzhenko 289b838d77 [kotlin] Optimize file.fileType calculation
#KTIJ-20095
2022-01-31 08:31:33 +00:00
Mads Ager e2c7290214 [JVM CLI] Prefer source over classpath.
If the class `A` is in a jar `previous.jar`, the following CLI
invocation will take that class instead of the `A` class
defined in `A.java`:

kotlinc -cp previous.jar A.java B.kt

This is problematic for build tools that put the jar for a
previous build on the classpath when recompiling some of the
files.

^KT-51025 Fixed.
2022-01-29 00:58:00 +01:00
Ivan Kylchik fca1909f4a Move interpreter's test from fir module to general tests-gen 2022-01-28 18:44:47 +00:00