Commit Graph

175 Commits

Author SHA1 Message Date
Dmitry Jemerov 49033e0002 rename Jet* classes to Kt* 2015-10-19 21:35:30 +02:00
Alexander Udalov a501878d60 Workaround circular dependency of KProperty1 and KClassImpl
This appeared after introduction of KProperty in delegated property convention
methods. If a KProperty1 instance is created while constructing a KClassImpl
instance before assigning the 'jClass' field, an NPE is thrown because the
constructor of that KProperty1 instance tries to lookup the declaring class of
the property, which in some case happens to be the exact KClassImpl we're
constructing. No test added because I was not able to reproduce the behavior in
an isolated environment
2015-10-19 15:20:20 +03:00
Alexander Udalov 82d2e623d3 Support a more optimized way of storing types in metadata
Together with almost every type now there's also an id which references a type
from a separate table. Storing such ids instead of Type messages will allow to
reduce the size of the metadata for files where types are used many times over
and over again. Currently only deserialization of such types is supported,
along with the former mechanism
2015-10-15 18:25:39 +03:00
Dmitry Petrov 8cd624a58a Drop package facades: code cleanup in Kotlin project. 2015-10-15 10:33:47 +03:00
Alexander Udalov 3c74f48f91 Pass KProperty instances to property delegates
Inherit KProperty from PropertyMetadata, cache corresponding KProperty objects
instead of PropertyMetadataImpl objects, add support for properties with 2
receivers
2015-10-14 20:45:24 +03:00
Andrey Breslav 8e7f6f3c8c Migrated from @HiddenDeclaration to @Deprecated(..., level = DeprecationLevel.HIDDEN) 2015-10-13 13:50:16 +03:00
Alexander Udalov 5f18cb8703 Rename files in reflection.jvm
Move KDeclarationContainer.functions to KClasses and make it accept only
KClass, since KPackage is deprecated anyway
2015-10-13 11:58:45 +03:00
Michael Bogdanov a09c8105c4 Support reflection on top level properties 2015-10-13 11:14:33 +03:00
Michael Bogdanov e8f9a9f3b8 Support reflection on @JvmField properties inside class companion 2015-10-13 11:14:32 +03:00
Michael Bogdanov f4b7913dd3 sanitizeAsJavaIdentifier function moved to JvmAbi 2015-10-13 11:14:32 +03:00
Michael Bogdanov b713328540 Fix reflection for internal properties without getter/setter 2015-10-13 10:50:10 +03:00
Alexander Udalov 9d626ef1d9 Rename KotlinCallable annotation to KotlinFunction 2015-10-11 17:10:40 +03:00
Alexander Udalov 9e4823ef82 Write module name to metadata, fix reflection for file facades
Module name will be used for proper introspection of internal members
2015-10-11 17:10:37 +03:00
Alexander Udalov 0218e0351b Deprecate KPackage, to be removed later 2015-10-11 17:10:37 +03:00
Alexander Udalov 37c36f806a Rename foreignKotlinClass -> getOrCreateKotlinClass
Previously this cache contained only Java (hence 'foreign') classes, that is
not the case anymore
2015-10-11 17:10:35 +03:00
Alexander Udalov fe737886cd Drop deprecated K*Function interfaces 2015-10-11 17:10:34 +03:00
Alexander Udalov 934ffed944 Don't write field signatures when not necessary 2015-10-11 17:10:30 +03:00
Alexander Udalov 864926ee2e Don't always write JVM method signatures to metadata
When the trivial type mapping (implemented in JvmProtoBufUtil) from
ProtoBuf.Type instances works fine, don't write the signature since it can be
loaded by exactly the same trivial type mapping
2015-10-11 17:10:30 +03:00
Alexander Udalov 9bf0502a31 Load new proto messages for functions and properties 2015-10-11 17:10:24 +03:00
Denis Zharkov ad68378836 Support loading methods from Java as common properties overrides 2015-10-10 12:29:14 +03:00
Michael Bogdanov fa32aa2950 SYNTHETIC flag for internal members 2015-10-07 18:10:56 +03:00
Mikhail Glukhikh 5e6c9f1979 Internal is deprecated in interfaces: reflection fix 2015-10-07 10:17:38 +03:00
Alexander Udalov 8c0a86617a Write JVM signatures to new protobuf messages 2015-10-03 00:59:33 +03:00
Pavel V. Talanov 5dd4843b5a reflection.jvm: Drop usages of KotlinBuiltIns.getInstance() 2015-10-01 17:53:09 +03:00
Alexander Udalov 1036506b25 Introduce new string table optimized for JVM class files
This format of the string table allows to reduce the size of the Kotlin
metadata in JVM class files by reusing constants already present in the
constant pool. Currently the string table produced by JvmStringTable is not
fully optimized in serialization (in particular, the 'substring' operation
which will be used to extract type names out of generic signature, is not used
at all), but the format and its complete support in the deserialization
(JvmNameResolver) allows future improvement without changing the binary version
2015-09-29 16:26:28 +03:00
Alexander Udalov 7d5bd3cf50 Simplify storage of JVM signatures in binary metadata
Store the whole method & field descriptor strings. Moving these strings to
separate annotation arguments later will allow to reuse them with the ones in
the constant pool, presumably allowing to save lots of space (up to 10%)
2015-09-29 16:26:25 +03:00
Alexander Udalov 5477570066 Extract interface out of NameResolver 2015-09-29 16:26:24 +03:00
Alexander Udalov 4a8d2b73d3 Remove deprecated stuff unused after M13 2015-09-22 18:22:55 +03:00
Denis Zharkov 9c4564a5a6 Get rid of deprecated annotations and modifiers in project code 2015-09-18 09:34:27 +03:00
Denis Zharkov 23ddf42981 Use JvmStatic in reflection instead of decapitalized 2015-09-18 09:34:25 +03:00
Alexander Udalov b1d9e5c961 Minor, improve exception message for reflection on built-ins 2015-09-15 13:11:16 +03:00
Michael Nedzelsky 5e35161d99 explicit internal modifier for some members of core/reflection.jvm in order to avoid generating documentaion 2015-09-08 02:04:09 +03:00
Michael Bogdanov 0de83b6f4c Default module name extraction 2015-09-07 16:29:15 +03:00
Michael Bogdanov b58479a169 TEST_MODULE_NAME extraction 2015-09-07 16:29:15 +03:00
Michael Bogdanov 974095313c Catch NoSuchFieldException 2015-09-07 16:29:11 +03:00
Michael Bogdanov 606b39698c Kotlin module name extraction 2015-09-07 16:29:11 +03:00
Michael Bogdanov 2ca9b3ae0e Code clean 2015-09-07 16:29:10 +03:00
Michael Bogdanov 9f0662468f Lazy module name propagation 2015-09-07 16:28:56 +03:00
Michael Bogdanov e83ec1017b Reflection support 2015-09-07 16:28:51 +03:00
Alexander Udalov df935f5bb7 Support reflection on lambdas and function expressions
Write a special annotation containing the bytes for the Callable protobuf
message and deserialize it at runtime properly

 #KT-9005 Fixed
2015-09-03 21:43:58 +03:00
Valentin Kipyatkov 4321969ba5 Restored properties "java" and "kotlin" in package kotlin.reflect.jvm but made them hidden 2015-09-03 15:55:57 +03:00
Yan Zhulanow 55b2029b3c Remove FIELD target from jvmStatic and platformStatic annotations 2015-09-02 20:36:48 +03:00
Yan Zhulanow e0c85cba23 Fix platformStatic in reflection-jvm 2015-08-31 15:33:09 +03:00
Yan Zhulanow 3624c4e5dc Use target priorities to split annotations to different descriptors 2015-08-31 15:33:05 +03:00
Alexander Udalov fb09c91714 Minor, rename PlatformStatic* -> JvmStatic* in reflection 2015-08-29 18:42:09 +03:00
Alexander Udalov a1097f7081 Add val KClass.staticProperties: Collection<KProperty0<*>>
To get static fields from Java classes
2015-08-29 18:37:41 +03:00
Alexander Udalov 593937d302 Support KCallable.callBy with map of parameters to arguments
callBy is able to handle optional parameters.

 #KT-8827 Fixed
2015-08-29 18:37:40 +03:00
Alexander Udalov 0d62680f63 Support KParameter.isOptional
#KT-8825 Fixed
2015-08-29 18:37:39 +03:00
Alexander Udalov fd97383f8a Fix mapping of jvmStatic functions
#KT-8800 Fixed
2015-08-29 18:37:38 +03:00
Alexander Udalov 9a8cf23ed4 Support KClass.companionObject and companionObjectInstance
#KT-7636 Fixed
2015-08-29 18:37:32 +03:00