Commit Graph

166 Commits

Author SHA1 Message Date
Georgy Bronnikov c015463926 IR: remove field fake overrides 2020-06-17 20:02:26 +03:00
Mikhail Glukhikh ab5cb13dae Rename: DescriptorBasedIr -> ObsoleteDescriptorBasedAPI 2020-06-16 19:17:14 +03:00
Mikhail Glukhikh 63394858ac Minor typo fix 2020-06-16 19:17:08 +03:00
Mikhail Glukhikh 7a0f986823 [IR] Introduce & use DescriptorBasedIr OptIn 2020-06-16 19:17:03 +03:00
Alexander Gorshenev 99c5585790 Allow dynamic types in ir fake override substitution arguments 2020-06-16 02:56:46 +03:00
Alexander Udalov d8aee421ac IR: don't store isPublic as field in IdSignature 2020-06-11 21:42:44 +02:00
Alexander Udalov 3154eca218 IR: use String instead of FqName in IdSignature.PublicSignature
FqName/FqNameUnsafe tend to eagerly compute things like
safe/parent/shortName which take a lot of space.

This change helps to lower strongly reachable memory just before codegen
in JVM IR by about 5% on a relatively big project.
2020-06-11 21:42:44 +02:00
Alexander Gorshenev ce1ef6c159 Fixing a bug with private accessors in IR fake override construction 2020-06-08 17:07:06 +03:00
Roman Artemev 5eae262264 [PLUGIN API] Implement custom linkage for plugin extensions 2020-06-03 12:17:14 +03:00
Roman Artemev f9c2c846f7 [IR] Move IrProvider and 'IrDeserializer' into separate package 2020-06-03 12:17:14 +03:00
Mikhail Glukhikh a239604c24 Rename & make public: Collection.collect -> collectForMangler 2020-06-02 18:43:16 +03:00
Mikhail Glukhikh 05d160b130 Revert "IR linked: introduce IrElement.isExpectMember instead of descriptor use"
This reverts commit 4b47eb35
2020-06-02 16:14:27 +03:00
Leonid Startsev 7c8c5b057f Extensible mechanism for plugin metadata during descriptor serialization
A mechanism that allows kotlinx.serialization plugin to preserve the
correct (program) order of properties after serializing/deserializing
descriptors to kotlin metadata, which is needed for correct and stable
json serialization of class hierarchies in incremental/multi-module scenario.
It uses protobuf extensions.
2020-06-01 17:48:16 +03:00
Alexander Gorshenev a112f8acb6 Moved symbol table emptiness assertion to later places,
so that the assert doesn't trigger in the plugin context
2020-05-31 06:00:33 +03:00
Alexander Gorshenev 5e56a52f94 Properly update modality and visibility of property accessors on fake override creation 2020-05-31 06:00:33 +03:00
Alexander Gorshenev 46e3649bd0 Moved all things related to fake overrides to a single directory 2020-05-31 06:00:32 +03:00
Alexander Gorshenev 06abbe468b Signature based fake override validation 2020-05-31 06:00:32 +03:00
Alexander Gorshenev 024385cbbd Construct fake overrides after IR deserialization 2020-05-31 06:00:32 +03:00
Alexander Gorshenev ee1ea15684 Adapted descriptor fake override construction from OverridingUtil.java to IR as IrOverridingUtil.kt 2020-05-31 06:00:32 +03:00
Alexander Gorshenev 2828aa9ce8 Typechecker and visibility utils for fake overrides 2020-05-31 06:00:32 +03:00
Alexander Gorshenev 789efc7c3a Created a deep copier good for fake overrides.
Adapted it from inliner copier.
It is capable of producing type substituted members.
2020-05-31 06:00:31 +03:00
Mikhail Glukhikh 4b47eb359a IR linked: introduce IrElement.isExpectMember instead of descriptor use 2020-05-28 14:02:58 +03:00
Roman Artemev 7644b4baec [KLIB] Improve performance a bit 2020-05-26 14:41:49 +03:00
Roman Artemev e573efb3a5 [JS SCRIPT] Handle IrScript in mangler correctly 2020-05-14 17:58:32 +03:00
Anton Bannykh 5b63dad1c3 JS IR: fix incremental compilation for stdlib 2020-05-13 19:15:18 +03:00
Roman Artemev 7737c76540 [PLUGIN API] Do postprocess after symbol resolve 2020-05-12 14:29:55 +03:00
Roman Artemev 9f99094780 [IR] Clean up linker interface 2020-05-12 14:29:54 +03:00
Roman Artemev 1e9c9ef7e0 [IR] Clean up linker code 2020-05-12 14:29:54 +03:00
Roman Artemev c38ba45c1b [JVM IR] Fix jvm linker 2020-05-12 14:29:52 +03:00
Sergey Bogolepov 0ed0152ee0 [Linker] Add option to control scope of DescriptorByIdSignatureFinder
Currently DescriptorByIdSignatureFinder performs lookup of descriptor
not only in the given module but also in its dependencies.
This behaviour is incorrect if we have some kind of
relation (e.g. mapping) between moduleDescriptor and found descriptor.
Thus, we add a handle to control search scope.
2020-04-21 19:09:07 +07:00
Roman Artemev cd931796bc [SERIALIZATION] Fix kotlinx.serialization plugin 2020-04-14 11:12:08 +03:00
Roman Artemev a9788f9506 [KLIB] Create an abstract class for module deserializer
- Introduce Ir-based Functional interface factory
 - Switch from LazyIr to pure
 - Use kotlin library to access raw bytes
 - Link dirty files against IC cache and dependencies instead of LazyIr
 - Move `DescriptorByIdSignatureFinder` from K/N to common
 - Support inline-bodies only MODE
2020-04-14 11:12:08 +03:00
Roman Artemev 8e295de593 [KLIB] Make sure float/double bits have fixed representation for NaN.
- Store float and double constants as fixed32/64 proto value
 and encode/decode them in our side.
2020-03-16 16:49:39 +03:00
Alexander Udalov 795d6ab407 Migrate UseExperimental->OptIn in project sources 2020-03-10 12:07:14 +01:00
Roman Artemev 7fff4e78e5 [KLIB] Do not include return type into mangle 2020-03-10 11:12:09 +03:00
Roman Artemev 62621de4fc [KLIB] Don't have a special mangle for internal declarations 2020-03-10 11:12:09 +03:00
Sergey Bogolepov 71cc288a14 [Linker][IdSignature] Rename classFqn property
classFqn is incorrect since this property represents
FqName of any declaration, including properties, functions and
type aliases.
2020-02-26 17:48:38 +07:00
Sergey Bogolepov 221d24c597 [Linker] Do not generate wrapped descriptor if descriptor is provided
Fixes metadata-based interop in Kotlin/Native.
2020-02-26 17:48:38 +07:00
Alexander Gorshenev 3eed0609b2 Brought back mppKlibs guard lost in rebase 2020-02-25 13:26:11 +03:00
Georgy Bronnikov fe009ac695 IR: restore reading common Klib from JVM
Adapt to changes in linker
2020-02-23 14:55:29 +03:00
Sergey Bogolepov 208c06516b [IR][Serialization] Allow backends to skip files
This change is required for Native interop libraries.
For enums and structs we generate full-blown IR classes that should not
be serialized because they will be generated anew.
2020-02-17 16:00:37 +07:00
Roman Artemev 6a37955a36 [KLIB] Implement new linker based on IdSignature
- Remove klib dependency on metadata and uniqID
 - Refactored proto format to make it more effective and compact
  -- Use special encoding for some types of data (coordinates, flags, types)
  -- Remove symbols table
  -- Use packed proto list if it is possible
 - Remove extension from metadata
 - Remove special ids for function interfaces
 - Fix klib IO
 - Fix incremental cache
 - General code clean up
2020-02-14 18:22:16 +03:00
Roman Artemev e81a7f10c1 [KLIB] Implement special encoding for Klib data 2020-02-14 18:22:15 +03:00
Roman Artemev bb04eae93e [IR] Implement IdSignature API
- Basic implementation of IdSignature classes and interafces
 - Abstract and platform Ir/Descriptor based signature builders
2020-02-14 18:22:15 +03:00
Roman Artemev 0254734bb5 [IR] Refactored Kotlin Mangler API
- Implement abstract Ir-based, Descriptor-based
 mangler computers and export checkers and corresponding platform
 specializations
 - Add runtime verifier which check whether all types of mangler
 produces the same type of data

Note: code migration is not finished yet
2020-02-14 18:22:15 +03:00
Anton Bannykh e8fba8bcb6 IR API: change val ... : MutableList to var ...: List for most lists
All mutable state for IR declarations should be either:
- var (mutable properties)
- or class member list

Mutable properties are straightforward to persist.

The class member list is handled in a special way.
2020-02-06 21:03:32 +03:00
Anton Bannykh 0bcde9dffc IR API: Make IrEnumEntry.initializerExpression IrExpressionBody
All non-declarations should be inside IrBody's now
2020-02-06 21:03:32 +03:00
Georgy Bronnikov e351d560d6 IR: remove KotlinIrLinker.checkAccessibility
This sanity check conflicted with cases where visibility test is
suppressed in the frontend.
2020-01-28 12:19:44 +03:00
Georgy Bronnikov f75400cc1a IR: avoid some calls of getUniqId() 2020-01-28 12:19:44 +03:00
Georgy Bronnikov 5ede65c525 JVM_IR: read Klib 2020-01-28 12:19:43 +03:00