Commit Graph

2248 Commits

Author SHA1 Message Date
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
Mikhail Zarechenskiy 86fd4da567 [UAST] Fix mapping types containing type aliases
#KT-27935 Fixed
2020-04-08 01:25:14 +03:00
Kevin Bierhoff 7448761dfd only stub default constructor when compiling against .java source files 2020-04-07 17:48:39 +02:00
Denis Zharkov c83860187c FIR: Add abstract equals/hashCode to ConeKotlinType
Otherwise they are incosistent when being added to sets of constraints
during type inference
2020-04-07 17:54:55 +03:00
Denis Zharkov 65e90743df FIR: Fix hanging inference case with intersection types 2020-04-07 17:54:55 +03:00
Denis Zharkov 81d9cf76f2 FIR: Add java.io.Serializable as supertypes to built-in classes 2020-04-07 17:54:55 +03:00
Denis Zharkov 168c7f306f FIR: Fix ambiguity for invoke candidates on qualifier receiver 2020-04-07 17:54:55 +03:00
Denis Zharkov 4cd93a9fec FIR: Add test for discrepancy in call resolution for qualifiers with old FE
^KT-38031 Open
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
simon.ogorodnik 42a48ef312 [FIR] Improve constraint errors rendering in html dump 2020-04-07 16:24:59 +03:00
simon.ogorodnik 2c8a9bf437 [FIR] Fix nullability rendering for class like types in html dump 2020-04-07 16:24:59 +03:00
simon.ogorodnik bd826f38bc [FIR] Fix specificity comparision for unsigned integers 2020-04-07 16:24:58 +03:00
simon.ogorodnik 851e2dbb68 [FIR] Implement equals & hashCode for candidates 2020-04-07 16:24:58 +03:00
simon.ogorodnik 7d3b2558f0 [FIR] Improve rendering for unsigned literals in html dump 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
Mikhail Glukhikh 32748ea741 [FIR] Change char constant rendering to prevent encoding inconsistencies 2020-04-06 16:41:58 +03:00
Mikhail Glukhikh 4cb4aae7ee [FIR2IR] Move backing field creation in Fir2IrDeclarationStorage 2020-04-06 16:41:58 +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
Ilya Gorbunov 8194652793 Allow placing Suppress on a type parameter
#KT-12448
2020-04-03 19:36:37 +03:00
Ilya Gorbunov fcada0a5e3 Make use of contracts of time measurement functions 2020-04-03 19:36:36 +03:00
Mikhail Glukhikh 75283c74ac [FIR] Generate type arguments for variable assignments 2020-04-03 17:21:39 +03:00
Mikhail Glukhikh d7460d47de [FIR] Generate dispatch & extension receivers for variable assignments 2020-04-03 17:21:21 +03: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
Dmitriy Novozhilov 238488d4fb [FIR] Fix collection subgraphs to drop from delegate calls 2020-04-03 15:22:58 +03:00
Mikhail Glukhikh b21da3910a [FIR] Set type arguments also in provideDelegate property reference 2020-04-03 13:42:06 +03:00
Mikhail Glukhikh 8bf4ec66a9 [FIR] Fix receiver type order in delegate property reference 2020-04-03 13:34:46 +03:00
Mikhail Glukhikh f374c36cd2 [FIR2IR] Generate property extension receiver references properly 2020-04-03 13:31:15 +03:00
Mikhail Glukhikh 4234438d8d [FIR] Generate thisRef more correctly for extension property 2020-04-03 13:30:55 +03:00
Mikhail Glukhikh f3f7bf70f6 [FIR] Set delegate field receiver properly 2020-04-03 13:29:55 +03:00
Mikhail Glukhikh 036b6c63f6 [FIR] During resolve, set correctly property reference type in delegate 2020-04-03 13:18:47 +03:00
Mikhail Glukhikh 58e00400f1 [FIR2IR] Support PROPERTY_REFERENCE_FROM_DELEGATE origin 2020-04-03 13:05:13 +03:00
Mikhail Glukhikh 5f8fadb220 [FIR2IR] Remove GET_PROPERTY origin from delegate field reads 2020-04-03 13:04:56 +03:00
Jinseong Jeon 94749855b9 FIR: fix visibility extension for fake override. 2020-04-03 13:03:50 +03:00
Dmitriy Novozhilov d620802a18 [FIR] Add equals and hashCode to ConeCapturedType 2020-04-03 10:09:13 +03:00
Dmitriy Novozhilov 7dd91df10b [FIR] Don't analyze with DFA already analyzed classes 2020-04-03 10:08:26 +03:00
Dmitriy Novozhilov 0b2536199b [FIR] Don't analyze delegated constructor calls twice 2020-04-03 10:08:25 +03:00
Dmitriy Novozhilov 20d0e8647d [FIR] Pass data flow to init blocks of local classes 2020-04-03 10:08:25 +03:00
Dmitriy Novozhilov 16b5b2dcef [FIR] Add symbol to FirAnonymousInitializer 2020-04-03 10:08:24 +03:00
Dmitriy Novozhilov bcd2e5ed2c [FIR] Add control flow graph to inplace lambdas 2020-04-03 10:08:24 +03:00
Dmitriy Novozhilov 1d39270b3e [FIR] Don't pass data flow to property accessors of non local classes 2020-04-03 10:08:24 +03:00
Dmitriy Novozhilov 1d1b8d3290 [FIR-TEST] Update cfg dumps according to previous commits 2020-04-03 10:08:23 +03:00
Dmitriy Novozhilov 6faf364a46 [FIR] Update cfg renderer
Now it renderers all subgraphs for each graph
2020-04-03 10:08:23 +03:00
Dmitriy Novozhilov d1422dbf9f [FIR] Don't pass analyzed lambda to data flow analyzer 2020-04-03 10:08:22 +03:00
Dmitriy Novozhilov 68b5e4d13f [FIR] Choose right cfg owner for postponed lambdas 2020-04-03 10:08:22 +03:00
Dmitriy Novozhilov 9fa0a2cc77 [FIR] Drop subgraphs of lambda arguments of delegate calls 2020-04-03 10:08:21 +03:00
Dmitriy Novozhilov 14db88cccb [FIR] Fix double resolution of default property accessors 2020-04-03 10:08:21 +03:00
Dmitriy Novozhilov 9bdd5e47ac [FIR] Fix equality for cfg nodes 2020-04-03 10:08:21 +03:00