Commit Graph

862 Commits

Author SHA1 Message Date
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
Michael Bogdanov 882f6113dc Initial internal member mangling 2015-10-07 18:10:54 +03:00
Denis Zharkov 6a1566a6dc Make JVM backend work with Collection.size as val
0. Such properties are called special because their accessor JVM name differs from usual one
1. When making call to such property, always choose special name
2. When generating Kotlin class inheriting such property generate `final bridge int size() { return this.getSize(); }`
3. If there is no `size` declaration in current class generate `bridge int getSize() { // super-call }`
2015-10-07 08:46:35 +03:00
Denis Zharkov 547aa2cda6 Load special java methods as properites
Currently only those that override special builtin properties (e.g. `Collection.size`)
Their modality is defined by method's modality
2015-10-06 23:56:17 +03:00
Denis Zharkov a02b64f0e3 Setup overridability rules for properties built on Java fields
- They overrides each other
- They do not overrides Kotlin propeties and vice versa
2015-10-06 23:56:17 +03:00
Denis Zharkov dfe93406d9 Minor. Inline parameter 2015-10-06 23:56:17 +03:00
Denis Zharkov 27b231cd7d Minor. Do not record method within resolveMethodToFunctionDescriptor 2015-10-06 23:56:17 +03:00
Alexander Udalov cb6d16d224 Advance ABI version after changes to binary format 2015-10-03 00:59:52 +03:00
Alexander Udalov bdd69d9e46 Use internal names in multifile class metadata
To reuse the strings already existing in the constant pool of the class file
2015-10-03 00:59:34 +03:00
Alexander Udalov 8c0a86617a Write JVM signatures to new protobuf messages 2015-10-03 00:59:33 +03:00
Alexander Udalov 4f21caecc4 Simplify AnnotationAndConstantLoader, use NameResolver from ProtoContainer 2015-10-03 00:59:32 +03:00
Alexander Udalov 14ec34e37c Refactor annotation and constant loader, simplify, drop some useless checks 2015-10-03 00:59:31 +03:00
Alexander Udalov 041af28166 Deprecate and don't write KotlinClass$Kind, to be removed later 2015-10-03 00:59:30 +03:00
Alexander Udalov 056bb3f833 Deprecate and don't write KotlinSyntheticClass$Kind, to be removed later 2015-10-03 00:59:28 +03:00
Alexander Udalov 5bb47c8365 Write KotlinInterfaceDefaultImpls annotation to DefaultImpls classes
Instead of KotlinSyntheticClass with kind = TRAIT_IMPL
2015-10-03 00:58:52 +03:00
Alexander Udalov e4090d3f30 Cleanup descriptors.proto, regenerate
- move enums and messages nested in Callable to top level, since they're likely
  to be reused in other messages soon
- delete obsolete comments: some did not any value, some became obsolete with
  custom options ("id in StringTable" -> name_id_in_table)
2015-10-02 20:30:55 +03:00
Pavel V. Talanov d5624708fb Add "java.io.Serializable" as supertype to java builtIns mapped to classes that are serializable on jvm
Implementation is hacky, relies on adding fictional supertype to corresponding classes
2015-10-01 17:53:16 +03:00
Pavel V. Talanov 76029ee9b2 Introduce JvmBuiltIns and DefaultBuiltIns, different instances of KotlinBuiltIns
Make KotlinBuiltIns an abstract class
JsPlatform has DefaultBuiltIns
2015-10-01 17:53:14 +03:00
Pavel V. Talanov 0ae842a05d 'descriptors' module exports 'deserialization', not the other way around
Also remove some of redundantly specified dependencies
2015-10-01 17:53:13 +03:00
Pavel V. Talanov b9da08d11c TypeIntersector: refactor it to being a static utility
Deal with intersecting empty set of types on the call site
2015-10-01 17:52:03 +03:00
Pavel V. Talanov 424d71e964 Remove reference to KotlinBuiltIns from CompanionObjectMapping
Make it a class
2015-10-01 17:51:57 +03:00
Zalim Bashorov 94b110936e Add the ability to get containing source file from SourceElement 2015-10-01 14:37:25 +03:00
Alexander Udalov 34d14939f9 Fix build after change in property accessor names 2015-10-01 02:14:25 +03:00
Valentin Kipyatkov 5afa91d4ec Restored back temporarily renamed properties 2015-09-30 22:50:27 +03:00
Denis Zharkov a101fffd9a Change INTERFACE_IMPL_CLASS_NAME: $TImpl -> DefaultImpls 2015-09-30 08:19:51 +03:00
Denis Zharkov 27bc62bd8e Minor. Rename constants: TRAIT_IMPL* -> DEFAULT_IMPLS* 2015-09-30 08:19:50 +03:00
Yan Zhulanow 32e2a550b4 'infix' modifier 2015-09-30 04:03:27 +03:00
Valentin Kipyatkov 2d0c1cd77d Advanced ABI version after accessor naming change 2015-09-29 18:38:42 +03:00
Valentin Kipyatkov 20bddce18d No synthetic property for false get-method like "issue()" 2015-09-29 18:32:25 +03:00
Valentin Kipyatkov 069ce12604 Accessor naming should be locale-independant 2015-09-29 18:32:24 +03:00
Valentin Kipyatkov 420c6856be Changed naming algorithm of accessor name generation: "isXXX" and "kClass" cases affected 2015-09-29 18:32:24 +03:00
Valentin Kipyatkov 98da621ab3 Temporary rename of properties starting with "is" and used from java code (will revert back after changing accessor naming policy) 2015-09-29 18:32:23 +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 542bfab96f Don't write unnecessary information to ValueParameter proto
Flags can have a default value and the index can be trivially computed almost
all the time
2015-09-29 16:26:28 +03:00
Alexander Udalov 6a8d0fbd75 Introduce infrastructure to separate string table from metadata on JVM
Nothing especially helpful happens here, this is only a big refactoring
introducing a separate string array for the string table, which is currently
always empty, but will contain actual strings soon
2015-09-29 16:26:27 +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 e749bc262d Delete deprecated Type.Constructor message, advance ABI version 2015-09-29 16:26:24 +03:00
Zalim Bashorov 8cb87b3e49 private -> internal where it's necessary 2015-09-25 21:16:00 +03:00
Yan Zhulanow bc727a170b Add 'operator' keyword 2015-09-23 21:25:51 +03:00
Michael Nedzelsky 2c952dcc22 Revert "add isKotlinSourceElement method to Source interface in order to recognize kotlin source elements during compilation"
This reverts commit c342f6870a.
2015-09-23 17:45:47 +03:00
Dmitry Petrov 5cdbdfc2cc - Annotate package facades with java.lang.Deprecated.
- Provide KotlinDelegatedMethod annotation on package facade members.
2015-09-23 17:41:12 +03:00
Denis Zharkov 8d13f08271 Load static final fields of appropriate types from Java as const 2015-09-23 08:20:57 +03:00