Commit Graph

1802 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 3e44bc805f [FIR] Return error type from common super type if it present 2019-08-22 10:55:07 +03:00
Ilya Chernikov 2ed8fa7624 Convert main task creating helper to lazy API, refactor accordingly 2019-08-21 20:20:08 +02:00
Alexander Udalov 5e3a11db8e JVM IR: remove property accessor name hack in InterfaceDelegationLowering
#KT-28434 Fixed
2019-08-21 15:14:04 +02:00
Alexander Udalov 14a6a06166 JVM IR: do not use GenerationState.typeMapper
The only remaining usages are in IrTypeMapper, MethodSignatureMapper and
in InterfaceDelegationLowering.generateDelegationToDefaultImpl
2019-08-21 15:14:03 +02:00
Alexander Udalov f64afbf152 JVM IR: reduce usages of IrTypeMapper.kotlinTypeMapper 2019-08-21 15:13:49 +02:00
Alexander Udalov 0c6ab69b52 JVM IR: do not use descriptors in IrTypeMapper.writeFormalTypeParameters 2019-08-21 15:13:49 +02:00
Alexander Udalov 598c6009f2 JVM IR: extract method signature mapping to MethodSignatureMapper 2019-08-21 15:13:47 +02:00
Alexander Udalov 6191fc10f0 JVM IR: introduce IrCallableMethod as a simpler replacement for CallableMethod 2019-08-21 15:10:57 +02:00
Alexander Udalov 7c4ed9c29e JVM IR: remove unused code, minor cleanup 2019-08-20 14:16:30 +02:00
Igor Chevdar 8d2ccb7bcd [IR] Taught inliner to work with inline suspend lambdas 2019-08-20 12:52:54 +03:00
pyos 7ff700ff97 JVM_IR: lower calls to @JvmStatic functions from other files.
Note: this currently results in invalid IR (but valid bytecode) if the
@JvmStatic function is imported, because its IR representation is
unlowered and therefore has a dispatch receiver, but the call will not.
2019-08-20 11:39:25 +03:00
Igor Chevdar ad8bcda99e [IR] Merged K/N inliner with the common one 2019-08-16 18:32:19 +03:00
Alexey Tsvetkov 3366ac4b18 Save incremental data with KLIB compiler 2019-08-15 15:11:52 +03:00
Alexey Tsvetkov fc49510049 Add tests for IC with JS IR BE 2019-08-15 15:11:52 +03:00
Georgy Bronnikov 20351b7c1b IR: correct type for a null const argument 2019-08-14 18:26:09 +03:00
Dmitry Petrov 986654b709 psi2ir: fix unsubstituted type parameters around SAM conversions
Preserve type substitution:
- when obtaining function type for SAM type;
- when generating SAM conversions for SAM adapter arguments;
- for "original" method corresponding to a SAM adapter.
2019-08-14 14:18:42 +03:00
Alexander Udalov 6b208f7c9c JVM IR: support LanguageFeature.UseGetterNameForPropertyAnnotationsMethodOnJvm 2019-08-14 12:34:57 +02:00
Dmitry Petrov e4f9314f94 Use ISE instead of NPE in serialization 2019-08-14 11:16:11 +03:00
Dmitry Petrov a9c961931c JS_IR: Support 'CHECK_NOT_NULL' intrinsic 2019-08-14 11:16:11 +03:00
Dmitry Petrov 7d49b72b79 JVM_IR: Support 'CHECK_NOT_NULL' intrinsic
TODO: migrate to changes related to KT-22275
2019-08-14 11:16:10 +03:00
Dmitry Petrov 7170439517 IR: '!!' is generated as 'CHECK_NOT_NULL' intrinsic
```
fun <T : Any> CHECK_NOT_NULL(x: T?): x =
  if (x != null) x else throw NullPointerException(...)
```

This allows to compile both Kotlin/JVM and Kotlin/JS effectively.
2019-08-14 11:16:10 +03:00
Ilya Matveev 949bb9d150 IR: Get rid of descriptors in tailrec calls collection
Issue #KT-33279 fixed
2019-08-13 19:56:46 +07:00
Ilya Matveev cafe2cdb12 IR: Fix fake-override resolution for fields
Earlier we used a result of a corresponding getter resolution to
obtain a fake overridden field. This approach is incorrect because
the getter resolved may not contain a backing field. This patch
fixes the issue by using the overriddenSymbols property of an
IrField directly.

Issue #KT-33034 fixed
2019-08-13 19:56:45 +07:00
Steven Schäfer d22814f6da JVM IR: Fix vararg handling in DefaultParameterInjector 2019-08-13 14:24:55 +02:00
Steven Schäfer 1543accf40 JVM IR: Remove vararg handling from ExpressionCodegen 2019-08-13 14:24:55 +02:00
Steven Schäfer 4d8d65abec JVM IR: Remove varargs from CallableReferenceLowering 2019-08-13 14:24:55 +02:00
Steven Schäfer 99f1329c14 JVM IR: Remove varargs from PropertyReferenceLowering 2019-08-13 14:24:55 +02:00
Steven Schäfer 4cef1c4901 JVM IR: Remove varargs from EnumClassLowering 2019-08-13 14:24:55 +02:00
Steven Schäfer 8d9f2f4238 JVM IR: Add a lowering to desugar varargs to arrays 2019-08-13 14:24:55 +02:00
Steven Schäfer a7b31ba42b Add a utility function to compute type substitutions for call 2019-08-13 14:24:55 +02:00
Steven Schäfer d61b276ebf JVM IR: Fix types in ArrayGet/Set intrinsics 2019-08-13 14:24:55 +02:00
Alexander Udalov ea0142da60 Use JVM name of getter in synthetic method for property annotations
#KT-31352 In Progress
2019-08-12 16:48:25 +02:00
Alexander Udalov dfea94aef5 Minor, use INTRINSICS_CLASS_NAME constant instead of hardcoded string 2019-08-12 16:09:24 +02:00
Alexander Udalov b970a57adb Generate version requirement on inline functions since API version 1.4
The old compiler will crash if it tries to inline a function that's
passing a lambda parameter into the new parameter null check method
`Intrinsics.checkNotNullParameter` because that usage is not considered as
inlinable by the old compiler (it only knows about
`Intrinsics.checkParameterIsNotNull`). Therefore we require that these
functions can only be read by compilers of version 1.3.50 or greater.

 #KT-22275 Fixed
2019-08-12 16:09:23 +02:00
Alexander Udalov e207c96336 Throw NPE instead of TypeCastException since 1.4
#KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Alexander Udalov 2baddb029c Use Intrinsics.checkNotNullParameter to throw NPE in parameter null checks
Similarly to previous commits, this method was unused, so we're changing
its semantics in API version >= 1.4.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Alexander Udalov 480313210a Use Intrinsics.checkNotNullExpressionValue to throw NPE in Java null checks
Similarly to previous commit, this method was unused since its
introduction before 1.0, so we're changing its semantics to throw NPE
and starting to use it with API version >= 1.4.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Igor Chevdar 6106b72283 [IR] Fixed bug with fake override building 2019-08-12 17:07:44 +03:00
Igor Chevdar 226013353d [IrSerializer] Removed hacks with functional interfaces 2019-08-12 17:07:43 +03:00
Igor Chevdar 00dc335559 [IrSerializer] Preparations for functional interfaces handling 2019-08-12 17:07:43 +03:00
Alexander Udalov cb8f70189d Minor, add debug info to assertion in AddContinuationLowering 2019-08-12 14:57:21 +02:00
Steven Schäfer 0c3c0989b4 JVM IR: Don't move inaccessible const fields out of interface companions 2019-08-09 15:22:30 +02:00
Steven Schäfer 73d2ae961c JVM IR: BridgeLowering boxing fixes 2019-08-09 12:14:44 +03:00
Steven Schäfer 6aa8ecd745 JVM IR: Remove bridge construction from CallableReferenceLowering 2019-08-09 12:14:44 +03:00
Mikhael Bogdanov 1eda42cb88 JVM_IR. Generate SMAP information for anonymous classes
#KT-28092 Fixed
2019-08-08 12:02:50 +02:00
Mikhael Bogdanov a444a40849 JVM_IR. Basic support of 'inlineCallSiteInfo' 2019-08-08 12:02:49 +02:00
Steven Schäfer f34a08cbbf JVM IR: Convert interface companion fields to static fields. 2019-08-08 12:01:52 +02:00
Steven Schäfer 471b515adb Avoid getTopLevelClass in firMode 2019-08-07 10:34:43 +02:00
Steven Schäfer 70aee4f9e2 JVM IR: Handle -Xassertion modes 2019-08-07 10:34:43 +02:00
Steven Schäfer 7b2edc6de8 Extract simple inlining utility from ArrayConstructorLowering 2019-08-07 10:34:43 +02:00