Commit Graph

116 Commits

Author SHA1 Message Date
Anton Bannykh 8e347f9f39 [JS IR BE] lateinit support
* Functions with IrExpressionBody are lowered to IrBlockBody
* Implemented throwUninitializedPropertyAccessException function
2018-09-21 18:20:11 +03:00
Roman Artemev affc827998 [JS IR BE] Support 1.3 coroutines in backend 2018-09-17 15:29:18 +03:00
Georgy Bronnikov f04733ef33 JVM_IR. support big arity 2018-09-13 18:44:47 +03:00
Denis Zharkov 9cb8a35275 Minor. Pull user-data related things to CallableDescriptor
Currently, we assume user data for all non-FunctionDescriptor
declarations is empty
2018-09-12 09:49:25 +03:00
Alexander Udalov fc87043cb3 Merge use-site targeted annotations into corresponding Annotations
Add PropertyDescriptor.backingField/delegateField to store annotations
on the field directly in an otherwise almost empty descriptor instance,
instead of storing them with use-sites in the corresponding property
descriptor. Instead of AnnotationWithTarget, create AnnotationDescriptor
instances in AnnotationSplitter. Change DescriptorRenderer to render
annotations on "related" declarations when needed, with the explicit
use-site target if applicable.

Most changes in diagnostic test data are related to the fact that
annotations which are known to have an incompatible use-site to the
declaration they're applied at (such as `@param:`-annotation on a
function), are now not loaded at all. It's fine because the code is
erroneous, so it doesn't really matter how do we load annotations with
invalid targets (some of this logic is also changed freely in subsequent
commits). Some changes are also explained by the fact that for example
an annotation on the property which is only applicable to FIELD is now
rendered with an explicit use-site target `@field:`, regardless of
whether it did have that use-site target syntactically or not.

Basically, after this change there's no point in calling
Annotations.getUseSiteTargetedAnnotations/getAllAnnotations anymore
because it's easier and more intuitive to just use Annotations of the
corresponding descriptor -- the backing / delegate field (introduced in
this commit) or the extension receiver / setter parameter (related
behavior was fixed in previous commits). Usages of
use-site-target-related methods will be refactored out in subsequent
commits
2018-09-06 19:13:11 +03:00
Sergey Bogolepov a46b28718e Add allScopes property to IrElementVisitorVoidWithContext 2018-09-05 09:56:48 +03:00
Roman Artemev 54e98fc014 [JS IR BE] Make coroutine compile separately from stdlib
* use accessors instead of direct field access
2018-09-04 12:43:39 +03:00
Roman Artemev 0b926af203 Add KotlinType in WrappedClassDescriptor & WrappedTypeParameterDescriptor 2018-08-31 15:34:18 +03:00
Roman Artemev fec8065fd0 Fix code review
Minor fixes
Fix JVM IR BE
Fix NATIVE
2018-08-31 15:34:18 +03:00
romanart afcdcf8217 Partially reimplement KotlinType based util using IrType 2018-08-31 15:34:18 +03:00
Roman Artemev d1621b80cc Fake wrapped descriptors first working draft
get rid of descriptors in Bridge and Enum lowerings
Replace property accessors function type with IrSimpleFunction because they couldn't be constructors
get rid of descriptors in Callable reference lowering
refactored descriptor factory and inner class lowering
Add isReified property to IrTypeParameter declaration
keep getting rid of descriptors
Get rid of descriptors in Shared Variable Manager
LocalDeclarationLowering also uses no descriptors
Fix psi2ir
Fix nested classes names
Fix outer reference in inner classes
Fix name generator
get rid of descriptors in coroutines - something is working
Fix name generator
Fix unbound symbols in JVM BE
Rename DeclarationFactory members
2018-08-31 15:34:18 +03:00
Alexander Udalov 34c033bcaf Take ReceiverParameterDescriptor in FunctionDescriptorImpl.initialize
Instead of just KotlinType. This will allow to pass annotations on the
receiver at call sites
2018-08-27 23:37:04 +02:00
Roman Artemev 85a8af13cf [JS IR BE] Fix constructor parent 2018-08-24 15:49:13 +03:00
Georgy Bronnikov 30a2058f74 Fix JVM_IR backend crashes when compiling for Android
^KT-23963 Fixed
^KT-23968 FIxed
^KT-23972 Fixed
2018-08-24 15:46:44 +03:00
Svyatoslav Kuzmich ff70b837ee [JS IR BE] Support local delegated properties 2018-08-15 13:35:14 +03:00
Svyatoslav Kuzmich 392ad521fd [JS IR BE] Reflection support 2018-08-15 13:35:14 +03:00
Leonid Startsev 28319a76df Access to ir and external symbol table 2018-08-09 16:16:10 +03:00
Leonid Startsev c3f66cda65 Lowering extension point 2018-08-09 16:16:09 +03:00
Mikhael Bogdanov 813e1ffa39 Initial support of function callable references 2018-08-09 14:22:46 +03:00
Mikhael Bogdanov da34299064 Temporary set public constructor visibility for lowered local declarations
Allow to support callable reference in next commits
2018-08-09 14:22:45 +03:00
Roman Artemev c62e4b4fcf [JS IR BE] Support coroutines
* Move FinallyBlockLowering to common part
* Fix catching of dynamic exception
* Fix bridges for suspend functions
* Disable explicit cast to Unit
* Run lowering per module
* Update some test data
2018-08-08 18:33:39 +03:00
Svyatoslav Scherbina e923c65704 backend.common: improve support for unsigned types 2018-08-02 16:29:39 +03:00
Svyatoslav Scherbina 1aac1c2d69 Prepare default arguments IR lowering for inline classes support
Allow `nullConst` to be customized by backend
2018-08-02 16:29:38 +03:00
Mikhael Bogdanov 0df6fddd0a Extract utils from ReferenceSymbolTable 2018-08-01 12:29:28 +02:00
Mikhael Bogdanov 1bf3f4bda7 Extract ReferenceSymbolTable, support lazy type parameters 2018-08-01 12:29:27 +02:00
Georgy Bronnikov 8478c73434 Make @JvmStatic work on JVM_IR 2018-07-13 13:43:02 +03:00
Mikhael Bogdanov da0a966d65 Initialize return type and use unit type in IrDelegationConstructorCall
(cherry picked from commit faac924)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 068859eece Minor: use right type for null literal
(cherry picked from commit 88c824b)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 92407c509f IR BE common: add KotlinType based utils
(cherry picked from commit d8be3a6)
2018-06-29 11:24:46 +03:00
Zalim Bashorov 686a3d631c IR BE common: provide type arguments count explicitly for ir calls to reduce dependency on descriptors
(cherry picked from commit af76ae2)
2018-06-29 11:24:46 +03:00
Zalim Bashorov f002e6030a IR BE common: use another ctor of IrGetValueImpl in LocalDeclarationsLowering
(cherry picked from commit 7e34d6e)
2018-06-29 11:24:46 +03:00
Zalim Bashorov d5906dd584 IR BE common: fix InnerClassesLowering
(cherry picked from commit 4239a5f)
2018-06-29 11:24:46 +03:00
Dmitry Petrov d5286874bd Fix circular dependency: TypeTranslator <-> ConstantValueGenerator
TODO proper DI?
2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina b11abeed6a IrTypes: migrate some code from backend.common
(cherry picked from commit 3788130)
2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina f1bdb48a76 IrTypes: comment backend.common code to be migrated by someone else
(cherry picked from commit 0491fc4)
2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina 25d0c57194 backend.common: remove obsolete lowerings
(cherry picked from commit 5d6b9c7)
2018-06-29 11:24:46 +03:00
Dmitry Petrov 353076f596 compiler/ir/backend.common is NOT a part of compiler/backend-common 2018-06-29 11:24:46 +03:00
Dmitry Petrov 4eb2fc66d0 IrTypes: deep copy with symbols
Preliminary implementation of type remapper (does nothing).
2018-06-29 11:24:46 +03:00
Dmitry Petrov 0f718ec2d8 IrTypes: Fix up some back-end code 2018-06-29 11:24:46 +03:00
Svyatoslav Scherbina cffe7fb23b backend.common: backport DefaultArgumentStubGenerator from Native 2018-06-21 18:18:03 +03:00
Svyatoslav Scherbina 830923e111 backend.common: backport LocalDeclarationsLowering from Native 2018-06-21 18:18:02 +03:00
Anton Bannykh 6df9919eba JS IR: add DefaultContructorMarker to the runtime 2018-06-21 13:27:17 +03:00
Mikhael Bogdanov a4308e983a Set proper parent for lowered local declaration 2018-06-21 11:18:35 +02:00
Mikhael Bogdanov 50d7e49211 Skip unmapped receiver in inner class lowering 2018-06-04 10:49:56 +02:00
Dmitry Petrov 2a0e7eb412 IR: split IrUtils.kt into common and backend-specific part 2018-05-25 09:40:51 +03:00
Mikhael Bogdanov 61f444f846 Avoid empty clinit generation 2018-05-18 12:58:00 +02:00
Mikhael Bogdanov f4f01efd1f Avoid descriptors usage in IrFunction flag calculation 2018-05-15 16:07:07 +02:00
Mikhael Bogdanov 9d36367fbd Minor. Code clean: use class kind utils 2018-05-15 16:06:30 +02:00
Mikhael Bogdanov 678b1101cb Add class kind utils 2018-05-15 16:06:28 +02:00
Mikhael Bogdanov 9546c36c3c Get rid of 'descriptor.isInner()' call 2018-05-15 16:06:00 +02:00