Commit Graph

4659 Commits

Author SHA1 Message Date
pyos 495cefe65d Dump bytecode in a test that shows the effect of recompiling inline funs 2020-04-08 07:04:16 +02:00
pyos 82899e6243 JVM_IR: reuse MethodNodes for inline functions in same module
This fixes the weird cases when a class gets overwritten by an imperfect
copy, reduces the number of classes in the output if an inline function
contains an inline call that causes it to have regenerated anonymous
objects, and makes inlining of same module functions a bit faster in
general. On the other hand, this may increase memory footprint a bit
because classes cannot be flushed to the output jar, as the inliner
would not be able to locate classes for anonymous objects if they have
already been unloaded from memory.
2020-04-08 07:04:16 +02:00
Alexander Gorshenev 97be5617ca Renamed -Xklib-mpp to -Xexpect-actual-linker to reduce user confusion 2020-04-08 05:23:12 +03:00
Denis Zharkov 81d9cf76f2 FIR: Add java.io.Serializable as supertypes to built-in classes 2020-04-07 17:54:55 +03:00
Mads Ager 03fb49bb38 [JVM_IR] Improve debugging behavior of inline functions
Specifically, this commit improves the stepping behavior of the IR
backend around functions with defaults.

  - Improved line numbers in the default handler itself for better
    stepping when inlined.

  - Improved source information on default arguments

  - Improved test coverage of stepping behavior in old and IR backends.

Improves the stepping behaviour around inline methods with default
arguments. In particular, we now accurately step through the
evaluation of default arguments, but do _not_ spuriously show the exit
from the $default handler.
2020-04-07 16:52:45 +02:00
pyos 516692008f JVM: add tests fixed by the last two commits
One was broken on JVM, the other on JVM_IR.
2020-04-07 15:42:41 +02:00
pyos 829343cf6f JVM: surround captured lambdas with conditional suspension markers 2020-04-07 15:42:41 +02:00
pyos c650c9570f JVM: use conditional suspension point markers 2020-04-07 15:42:41 +02:00
simon.ogorodnik bd826f38bc [FIR] Fix specificity comparision for unsigned integers 2020-04-07 16:24:58 +03:00
Dmitry Petrov dae8872aba KT-37779 Treat named value arguments in vararg as arguments with '*' 2020-04-07 15:40:43 +03:00
Jinseong Jeon fa9d79392f [FIR] Handle lateinit local variable properly 2020-04-07 14:06:38 +03:00
Juan Chen 882e6931d6 [FIR] Add backing fields to const properties during Fir2Ir translation 2020-04-06 16:41:57 +03:00
Jinseong Jeon 08ca6f5f99 [FIR2IR] Set @Metadata when declaring IR symbols 2020-04-06 16:41:57 +03:00
Dmitry Petrov d5ace43614 KT-37986 Force boxing of inline class returned from function reference
KT-37998 Provide KotlinType for safe call
2020-04-04 01:32:45 +03:00
pyos 5ed845d0b4 JVM_IR: reuse same bodies for suspend funs and $$forInline versions 2020-04-03 19:51:45 +02:00
Dmitry Petrov a422a12407 Minor: update testData
In BridgeTest::testFakeOverrideMisleadingImplementation,
order of generated bridges has changed slightly
(but the overall set of generated bridges remains the same).
2020-04-03 18:31:39 +03:00
Mikhail Glukhikh d7460d47de [FIR] Generate dispatch & extension receivers for variable assignments 2020-04-03 17:21:21 +03:00
Alexander Udalov 774fc32f3e JVM IR: support optimized callable reference superclasses
See KT-27362.

 #KT-37334 Fixed
2020-04-03 15:37:56 +02:00
Alexander Udalov bb1a12e28e JVM IR: use correct owner for callable references in optimized multifile classes
The owner should always be the facade class, because the part class is
package-private and will be inaccessible from other package.

Note that in the old backend, function references already do have the
facade as the owner correctly, but property references don't, this is
reported as KT-37972.
2020-04-03 15:37:56 +02:00
Mikhail Glukhikh f374c36cd2 [FIR2IR] Generate property extension receiver references properly 2020-04-03 13:31:15 +03:00
Mikhail Glukhikh f3f7bf70f6 [FIR] Set delegate field receiver properly 2020-04-03 13:29:55 +03:00
Mikhail Glukhikh e676967056 Unmute two FIR black box test (related to JDK version) 2020-04-02 17:41:50 +03:00
pyos a75408b1ed JVM_IR: use non-nullable types as SAM super types
The wrappers for conversions to nullable and non-nullable SAM types are
the same, so differentiating those has no effect other than class name
collisions.
2020-04-02 15:40:17 +02:00
Jinseong Jeon 44c34ab8c3 [FIR2IR] Don't create fake overrides for private property accessors 2020-04-02 12:43:06 +03:00
Jinseong Jeon 3e6b38a921 [FIR] Fix type reference for 1st arg of GetClassCall 2020-04-02 12:42:50 +03:00
Denis Zharkov 9abe669443 FIR: Fix resolution for invokes on class qualifiers 2020-04-02 12:10:50 +03:00
Mikhail Glukhikh ffc22f4190 [FIR] Unmute two passing black box tests 2020-04-02 10:28:07 +03:00
Dmitry Petrov 24b8495e00 KT-30419 Box inline classes in return types of covariant overrides
Use boxed version of an inline class in return type position for
covariant and generic-specialized overrides.

Also fixes KT-35234 and KT-31585.
2020-04-01 22:59:14 +03:00
Alexander Udalov e44f12d7b0 Minor, unmute passing FIR black box tests 2020-04-01 19:33:45 +02:00
Mathias Quintero 34a64d9171 Making var arg kParameters default to empty array no argument given
fixes KT-29969
2020-04-01 16:00:16 +02:00
Alexander Udalov 3269a7e693 Change behavior of equals/hashCode on adapted function references
Function references are now equal if they refer to the same function,
and if the parameter/return type adaptation, which happens when a
reference is used where some function type is expected, is exactly the
same. This includes the number of expected positional parameters (which
can be affected by defaults/varargs), whether the coercion of vararg
parameter to Array type happened, and whether the coercion of return
type to Unit happened.

 #KT-37543 Fixed
2020-04-01 14:18:49 +02:00
Ilya Gorbunov 1c93911279 Make Double and Float known values constant
#KT-13887
2020-04-01 08:06:57 +03:00
Mikhail Glukhikh 630adb34db [FIR] Don't provide receiver as value in delegated constructor call 2020-03-31 20:28:24 +03:00
Mikhail Glukhikh a377a6fccb [FIR2IR] Handle references to constructors separately 2020-03-31 20:27:40 +03:00
Mikhail Glukhikh 282509b0da [FIR2IR] Provide object receivers for callable references 2020-03-31 20:27:24 +03:00
pyos e98bdc6f8e JVM: preserve call site markers when inlining lambdas
and default functions into their own stubs.

Fixes #KT-35006
2020-03-31 16:06:57 +02:00
pyos 9d21800d8f JVM: fix SMAP range extension logic
If `mapLineNumber` was called in non-monotonic order, e.g. N then N+2
then N+1, the first two calls created a range that spans [N; N+2] but
the third call did not reuse it.
2020-03-31 16:06:57 +02:00
Mikhail Zarechenskiy 38a719cb22 [NI] Fix trace manipulations for builder inference and ::-expressions
For a class literal Type::class we are resolving Type as a constructor,
 getting all diagnostics (about missing arguments, for example) and then
 just not committing this trace with errors

 #KT-37626 Fixed
2020-03-31 15:50:58 +03:00
Jinseong Jeon ff104f4037 [FIR2IR] Set proper visibility of backing fields 2020-03-31 13:12:36 +03:00
Dmitry Petrov 4ade669b9b Minor: unmute 2 tests fixed in FIR 2020-03-30 21:10:59 +03:00
Pavel Punegov d0e28d7c8d Ignore Java-sepcific test in Native 2020-03-30 18:31:50 +03:00
Dmitry Petrov cec64a2ec7 KT-37861 'this' is uninitialized in constructor default parameters 2020-03-30 17:23:15 +03:00
Jinseong Jeon 078cf02c8a FIR: Provide dispatch receiver for 'field' according to property type 2020-03-30 16:57:53 +03:00
Mikhail Glukhikh a0978a50e8 [FIR2IR] Correct 'this' conversion when it points to non-closest class 2020-03-30 16:57:52 +03:00
Jinseong Jeon 4388b30f87 [FIR] Fix anonymous object handling as 'this' receiver 2020-03-30 16:57:52 +03:00
Mikhail Glukhikh d1fc6ff6ee [FIR2IR] Don't provide backing field symbols for non-Java property refs 2020-03-30 16:23:11 +03:00
Mikhail Glukhikh d4ae992417 [FIR] Apply type arguments for callable references 2020-03-30 16:23:11 +03:00
Mikhail Glukhikh 810b607a65 [FIR2IR] Provide receivers also for property callable references 2020-03-30 16:23:10 +03:00
Mikhail Glukhikh 697006d782 [FIR2IR] Re-use receiver application logic in callable ref conversion 2020-03-30 16:23:10 +03:00
Juan Chen d8539fdde9 [FIR2IR] Add dispatch & extension receivers to callable references 2020-03-30 16:23:10 +03:00