Commit Graph

904 Commits

Author SHA1 Message Date
Alexander Udalov 32a9bddbf9 Increase ABI version after yet another change to binary format 2015-10-15 18:25:42 +03:00
Alexander Udalov 9eb2e16b94 Support strings directly in JVM string table
For small strings it may be beneficial to store them as is in the proto at one
point instead of in a class annotation, because each annotation argument in the
classfile has a constant overhead which may be significant for small strings
2015-10-15 18:25:41 +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 bd5f068454 Fix build after subtle change of Enum.name from function to property 2015-10-14 22:00:48 +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
Mikhail Glukhikh 4614e74e3f isFromJavaOrBuiltins() is now public (compilation fix) 2015-10-14 20:40:34 +03:00
Mikhail Glukhikh d4a1a469b7 Number rename: xxxValue() --> toXxx(), test 2015-10-14 20:40:21 +03:00
Mikhail Glukhikh f8a356747e Stdlib rename: 'name' and 'ordinal' are now properties in Enum, same name functions are deprecated 2015-10-14 20:40:13 +03:00
Mikhail Glukhikh 78cfeb0d7d Stdlib rename: List.indexOf(T), List.lastIndexOf(T), MutableCollection.removeAll(Collection<T>), MutableCollection.retainAll(Collection<T>) 2015-10-14 20:40:09 +03:00
Denis Zharkov e062e32f95 Do not load special builtin overrides from Java as synthesized
It has been done just to avoid clashes with real declarations that look
like our builtins: e.g. 'String removeAt(int index) {}' and 'String remove(int index) {}'in Java.

But synthesized members are even weaker than extensions.

Solution is just to ignore the latter declaration and treat first as effective override
of out builltin.
2015-10-14 20:39:51 +03:00
Denis Zharkov 6fa8083a70 Transform builtin Map declaration and adjust stdlib 2015-10-14 20:39:38 +03:00
Denis Zharkov 1305d9755a Transform CharSequence.length to property 2015-10-14 20:39:29 +03:00
Denis Zharkov 6c0d55e4ed Minor. Rename kotlin file and package part: builtinsPropertiesUtil -> specialBuiltinMembers 2015-10-14 20:39:27 +03:00
Denis Zharkov 0a6bf31a2c Refactor util methods
Group semantically similar parts by objects
2015-10-14 20:39:24 +03:00
Yan Zhulanow 275f3f8954 'operator' checks 2015-10-14 01:29:10 +03:00
Yan Zhulanow bc3d1ddda0 Remove old 'get' delegate convention in interfaces 2015-10-14 01:29:09 +03:00
Alexander Udalov 78829b9e8f Minor, drop some obsolete usages of TRAIT in compiler 2015-10-13 20:29:39 +03:00
Michael Bogdanov f4b7913dd3 sanitizeAsJavaIdentifier function moved to JvmAbi 2015-10-13 11:14:32 +03:00
Dmitry Petrov 7e9e427d4c Java 8 rules for method overrides:
- report errors on implementing methods of Any in interfaces
- update testData

~~~

Java 8 override restrictions: interface can't implement a method of 'Any'
- update compiler sources
2015-10-12 14:12:31 +03:00
Dmitry Jemerov 1523d5bcbf removing static type assertions work in progress 2015-10-12 11:11:23 +02:00
Denis Zharkov 6d864e0854 Adjust collection stubs generating to 'remove' transformation
See substitutedList* tests in Backend
2015-10-11 19:59:30 +03:00
Denis Zharkov 89ded4ab1d Implement hack to support both remove() and removeAt() in MutableList<Int>
Also add couple of tests about CharSequence.get
2015-10-11 19:57:22 +03:00
Denis Zharkov 742a538aed Support loading builtin methods from Java with different names 2015-10-11 19:57:22 +03:00
Denis Zharkov a98d1e1e55 Minor. Convert some properties to functions 2015-10-11 19:57:08 +03:00
Alexander Udalov 9d626ef1d9 Rename KotlinCallable annotation to KotlinFunction 2015-10-11 17:10:40 +03:00
Alexander Udalov d4320b43fa Delete useless class, simplify reading class visitor 2015-10-11 17:10:38 +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 790c59d9e5 Increase ABI & stub version
See previous commits for motivation
2015-10-11 17:10:36 +03:00
Alexander Udalov a4732b442d Don't create KClass and KPackage instances in <clinit>
This proved to be a fragile technique, which probably doesn't even improve
performance in most cases but has lots of unexpected problems: unconditional
initialization of reflection classes, increasing the size of the bytecode, bugs
with <clinit> in annotations on JVM 6, inability to support conversion of a
class from Kotlin to Java without recompiling clients which use it
reflectively, etc.
2015-10-11 17:10:35 +03:00
Alexander Udalov 8c4d7fdf24 Drop deprecated nested classes from Kotlin metadata annotations 2015-10-11 17:10:33 +03:00
Alexander Udalov 1c229d173e Forget old classes from jet.runtime.typeinfo.*, drop JetValueParameter 2015-10-11 17:10:32 +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 aa95375029 Fix incorrect copy-paste during proto messages refactoring
Annotations on properties should be loaded not when the message is Property
(this happens for getters/setters as well), but when the kind is explicitly set
to PROPERTY. Also restore construction of JVM signatures for constructors
2015-10-11 17:10:26 +03:00
Alexander Udalov e4efa27b76 Drop Callable and primary/secondary constructor proto messages 2015-10-11 17:10:26 +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
Yan Zhulanow 1f2b4e20fe Replace get() and set() to getValue() and setValue() (property delegates) 2015-10-09 22:49:16 +03:00
Michael Bogdanov a3e0205aec JvmAbi increased 2015-10-09 16:25:19 +03:00
Michael Bogdanov 60d1736b97 Instance field generation in objects 2015-10-09 16:25:16 +03:00
Zalim Bashorov e9b138557b Report error when try to access to static field which come from many sources 2015-10-09 15:00:59 +03:00
Denis Zharkov 80da320c2c Customize JVM signature for Collection's members
- Do not write signature for `contains`
- Write signature for `containsAll` as it's declared like `containsAll(Collection<?>)`
2015-10-09 14:40:33 +03:00
Denis Zharkov 1f52dfccdb Setup specific loading contains/containsAll from java
If they override Kotlin collection members

contains(Object) -> contains(E)
containsAll(Collection<?>) -> containsAll(Collection<E>)
2015-10-09 14:40:33 +03:00
Zalim Bashorov ae2831338b Load Java static members from parents 2015-10-08 19:33:29 +03:00
Yan Zhulanow d90585624f Add 'DeprecationLevel' parameter to 'Deprecated' 2015-10-08 18:31:08 +03:00
Yan Zhulanow 937d1913b8 Automatically put 'operator' modifier on appropriate Java methods 2015-10-08 18:31:07 +03:00
Ilya Gorbunov 90e5ee8a7e Replace KotlinPackage legacy facade with corresponding package parts. 2015-10-07 22:36:29 +03:00
Mikhail Glukhikh 0cc861f00b Exposed visibility checking, a set of exposed visibility tests, some test fixes
Effective visibility mechanism introduced.
Local is considered as public, java protected as Kotlin protected, java package private as Kotlin private.
2015-10-07 20:15:16 +03:00
Michael Bogdanov 264d7da450 PACKAGE_VISIBILITY normalization chaged to PROTECTED 2015-10-07 18:10:55 +03:00