Commit Graph

10 Commits

Author SHA1 Message Date
Pavel Mikhailovskii 06d3e1d8bd KT-55005 Do not generate CHECKCAST before AASTORE 2022-12-21 15:06:07 +00:00
Sergey.Shanshin 339b152390 Implemented caching of child serializers
Resolves Kotlin/kotlinx.serialization#1918

Merge-request: KT-MR-7578
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2022-11-23 19:53:44 +00:00
Sergey.Shanshin f4845b8dd9 Marked write$Self and $serializer from serialization as synthetic 2022-10-11 17:05:03 +00:00
Leonid Startsev ad2adadb36 Remove OperationType.PLUGIN_DEFINED type:
instead, plugins should emit the code similar to the TYPE_OF one with
a special call to MagicApiIntrinsics.voidMagicApiCall directly afterwards.

This is required because old compiler need to correctly inline code
rewritten by plugin.
2022-09-16 14:34:29 +00:00
Leonid Startsev eae588abea Improve line numbers handling in serialization intrinsic
Fix nullable serializers on top-level & method with incorrect receiver

Improve handling of different runtime versions
2022-09-16 14:34:29 +00:00
Leonid Startsev aac9a06474 Also support intrinsification for SerializersModule.serializer<T>()
method that fallbacks to module.getContextual().
2022-09-16 14:34:28 +00:00
Leonid Startsev a59f5f407b Introduce support for plugin-defined intrinsics in JVM IR backend:
Add intrinsic for kotlinx.serialization.serializer<T>() function.

Plugin intrinsic for old backend is removed because it is too hard
and unjustifiable to unify them.
2022-09-16 14:34:28 +00:00
Leonid Startsev f9edbd825a Introduce support for plugin-defined intrinsics in old JVM backend:
(Old is created first because all intrinsics emit bytecode anyway)

Provide intrinsic for serializer<T>() function so it won't
invoke typeOf() construction and KType->KSerializer conversion
making it fast and truly reflectionless

Add support for recalculating stack size in plugin-defined intrinsics
since it is needed for correct work:
Unify method for recalculating stack size with existing typeOf intrinsic

Add testdata for IR for future intrinsic in IR
2022-09-16 14:34:28 +00:00
Dmitriy Novozhilov a2ffba275c [Serialization] Migrate all tests to new test infrastructure 2022-09-05 10:20:05 +00:00
Dmitriy Novozhilov cc00dcc038 [Serialization] Reorganize module structure 2022-08-22 17:23:18 +03:00