Commit Graph

25 Commits

Author SHA1 Message Date
Dmitry Petrov 851980e36f JVM_IR KT-45103 optimize direct invoke for lambdas and callable refs 2021-05-18 22:20:12 +03:00
Jinseong Jeon 99286a6ce3 FIR2IR: introduce & use ClassId-based lookup for local class as IrParent 2020-08-26 10:08:16 +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 de0c9a5c73 FIR: use dispatch receiver of the enclosing function if any. 2020-03-25 08:27:21 +03:00
Mikhail Glukhikh 20c4a7b244 [FIR2IR] Introduce staged transformation (first step)
Now FE IR -> BE IR transformation is performed in multiple stages
controller by Fir2IrConverter. Stages are
 * files & classes registration
 * supertypes & type parameters handling
 * functions & properties signature generation
 * body generation

After each step we have guarantee (with exception of local classes &
type inference combination, and external symbols) that required symbols
(class/function/property/variable/type parameter)
are already bound to real declarations and have correct parents.

This commit also fixes incorrect parents for local classes
2020-03-13 12:18:02 +03:00
Mikhail Glukhikh ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh cfa626ad77 FIR2IR: introduce conversion scope, remove dispatch receiver for lambdas 2020-03-04 16:55:31 +03:00
Dmitry Petrov 6ad159bb01 JVM: Rewrite companion object accessor generation
Old version handled only private companions correctly.
Some situations require multiple companion object accessors
(including accessors for protected companion objects from supertypes)
to be generated in the corresponding class.
2020-01-14 16:12:18 +03:00
Juan Chen 573188bdc4 [FIR2IR]: fix translation of this references in instance methods
Currently FirThisReceiverExpression of instance methods are translated
to references of the class' thisReceiver,
not the method's dispatch receiver,
which causes problems with IrFrameMap::typeOf,
as the class' thisReceiver is not in the typeMap.

This commit translates non-qualified "this" references of
instance methods to references of the methods' dispatch receiver.
2020-01-10 10:43:07 +03:00
Mikhail Glukhikh 15f373a864 FIR2IR: support object receiver case (this fixes 24 black box tests) 2019-12-27 13:46:05 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Alexander Udalov 5b58eb8491 Remove LANGUAGE_VERSION from non-coroutine codegen tests
Most of these tests used this directive as a way to opt in to a new
language feature, and most of those features are already stable for a
long time, so no opt-in is needed. Some other tests used the directive
to opt out from a language feature, replace those by the `LANGUAGE`
directive. One test used the directive to test behavior that actually
depended on the API version; use `API_VERSION` directive there instead.
2018-12-20 12:53:23 +01:00
Georgy Bronnikov 376eef05f5 JVM_IR. Accessor lowering 2018-10-15 21:52:50 +03:00
Georgy Bronnikov ade640eadb JVM_IR. Support compile time constants 2018-10-01 12:25:55 +03:00
Dmitry Petrov 0dd04c3424 Postpone companion object field visibility
Have to reconsider this issue because of interface companion objects.
2018-09-27 10:35:23 +03:00
Dmitry Petrov 792ff3c39e Generate private interface companion object as package-private synthetic 2018-09-27 10:35:23 +03:00
Dmitry Petrov 7949ac1080 Use common instance receiver generation logic for 'this' expression
Otherwise it would skip private companion object accessor generation.
2018-09-27 10:35:23 +03:00
Georgy Bronnikov 487f500f85 Revert "JVM_IR. Support compile time constants"
This reverts commit 055215c54f.
2018-09-25 05:24:48 +03:00
Georgy Bronnikov 055215c54f JVM_IR. Support compile time constants 2018-09-25 01:38:51 +03:00
Roman Artemev cc14442be1 Add tests for primitive companion object
Update test data
2018-08-24 14:58:42 +03:00
Mikhael Bogdanov 357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Mikhael Bogdanov 06b16a6459 Unmute ir-tests after prev commit 2018-08-09 14:22:46 +03:00
Mikhael Bogdanov e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Dmitry Petrov 46a3f7420c When in debugger context, access private companion object directly 2018-06-26 16:46:55 +03:00
Dmitry Petrov d35a92a81d Generate accessor for private companion object 2018-06-22 16:53:07 +03:00