Alexander Udalov
2eebcd91c0
Make annotation deserializer not depend on VirtualFile & ASM
...
KotlinJvmBinaryClass now has its own visitor interfaces, which are an
abstraction over ASM visitors and the ones that will be implemented over
reflection
2013-10-02 17:05:50 +04:00
Alexander Udalov
7eff1292f0
Make an abstraction over VirtualFileFinder
...
Java descriptor loader now can work with KotlinClassFinder, which finds
abstract KotlinJvmBinaryClass'es: they are based on VirtualFile in the
compiler/IDE and will be based on j.l.Class in the reflection
2013-10-02 17:05:50 +04:00
Alexander Udalov
c5bed7a246
Remove hack from AnnotationDescriptorDeserializer
...
Now that package fragment classes are generated to "*Package-filename-hash", we
can use virtualFileFinder to find such classes by FQ name. Support
KotlinPackageFragment annotation, by which VirtualFileFinder will determine
that a class was compiled by Kotlin compiler
2013-10-02 17:05:49 +04:00
Alexander Udalov
fdc631d595
Increase ABI version after changes to package fragment names
2013-10-02 17:05:47 +04:00
Alexander Udalov
fc4e13f573
SerializedDataHeader now always has valid annotationData
...
This helps to avoid errors of checking 'instanceof SerializedDataHeader' but
forgetting to check if it 'isCompatibleKotlinCompiledFile'
2013-10-02 02:14:51 +04:00
Alexander Udalov
a97bb80216
Serialize FQ names of Kotlin classes
...
This helps to avoid a nasty hack with loading inner Kotlin classes in JDR,
which makes it a bit easier to 'lazify' JDR, since now the container of a
Kotlin class is no longer required to be resolved eagerly before resolution of
the class itself
2013-09-30 22:43:18 +04:00
Alexander Udalov
ee92ebe941
Move Kotlin descriptor loading to kotlin/ package
2013-09-30 22:43:17 +04:00
Alexander Udalov
fa9307d08c
Delete unused method from VirtualFileFinder
2013-09-30 22:43:17 +04:00
Alexander Udalov
b42a3e6f6c
Write KotlinPackageFragment annotation to package$src classes
2013-09-30 22:43:17 +04:00
Alexander Udalov
afa1f5c947
Move nested class to top-level
2013-09-30 22:43:17 +04:00
Alexander Udalov
84f64a5dfb
Refactor KotlinClassFileHeader
...
Split into two subclasses: KotlinClass/KotlinPackage-annotated classes and
JetClass/JetPackage-annotated classes
2013-09-30 22:43:17 +04:00
Alexander Udalov
e4d538c668
Move KotlinClassFileHeader to header/ package
2013-09-30 22:43:16 +04:00
Alexander Udalov
1f466ff57d
Simplify logic in KotlinClassFileHeader
...
When processing annotations, we should ensure not only that we have no more
than one KotlinClass/KotlinPackage annotation, but any supported header type at
all. Also instead of throwing an exception it's safer to just log the error
2013-09-30 22:43:16 +04:00
Alexander Udalov
92cc0ddd1f
KotlinClassFileHeader is now nullable everywhere
...
'null' means there's no header. This makes all of KotlinClassFileHeader's
fields non-null
2013-09-30 22:43:16 +04:00
Alexander Udalov
9e9b3c7284
Make KotlinClassFileHeader immutable, make its inner class nested
2013-09-30 22:43:16 +04:00
Alexander Udalov
e981681d3e
Remove KotlinClassFileHeader.HeaderType.NONE
...
Use null instead
2013-09-30 22:43:16 +04:00
Alexander Udalov
b4d9fb75d8
Minor refactorings in KotlinClassFileHeader
2013-09-30 22:43:15 +04:00
Alexander Udalov
b9ce7f9289
Remove dependency of annotation deserializer on ASM Type
2013-09-30 22:43:15 +04:00
Alexander Udalov
ed6f908049
Move JavaProtoBufUtil utilities to where they're used
...
Serialization goes to backend: it's not needed in runtime, at least in the
state in which it is now (dependent on ASM).
Deserialization goes to AnnotationDescriptorDeserializer. Inline some methods,
remove unneeded abstractions.
This removes dependency of serialization.java on ASM
2013-09-30 22:43:15 +04:00
Alexander Udalov
07f1e61146
Remove unneeded asserts from JavaSupertypeResolver
...
Don't do anything special if a Java class happens to extend jet.JetObject: it's
not a Kotlin class and we should collect all its supertypes correctly
2013-09-27 16:01:55 +04:00
Andrey Breslav
0d84565570
name and containingDeclaration pulled up
2013-09-26 09:05:00 -07:00
Andrey Breslav
65b3d5eac5
Optimization: do not read data from input streams, use contents cached in VFS
2013-09-26 09:04:58 -07:00
Alexander Udalov
6f5cd974a3
Remove unneeded dependencies on 'frontend'
...
Move the two needed in 'descriptor.loader.java' classes to 'descriptors'
2013-09-20 18:02:13 +04:00
Alexander Udalov
b7f1e61be9
Add JetType.isError()
...
Instead of ErrorUtils.isErrorType() which does several instanceof checks anyway
2013-09-18 16:41:48 +04:00
Alexander Udalov
7e72494ddb
Remove unused 'trace' parameter in ModuleConfiguration
2013-09-18 16:40:36 +04:00
Alexander Udalov
8400d2b8cf
Refactor OverridingUtil.resolveUnknownVisibilities
...
Get rid of dependency on BindingTrace, move the corresponding error reporting
logic to OverrideResolver
2013-09-18 16:40:35 +04:00
Alexander Udalov
6ca71349f8
Create DescriptorFactory utility class
...
Will contain utilities needed to create different common descriptors, such as
default getters/setters, enum values/valueOf methods, etc.
2013-09-18 16:40:34 +04:00
Alexander Udalov
effbdcaa4c
Move utilities out of OverrideResolver
2013-09-18 16:40:34 +04:00
Svetlana Isakova
96db2ecabd
added different errors instead of ERROR_COMPILE_TIME_VALUE with different text
...
check type for constants in DataFlowUtils
2013-09-13 16:04:17 +04:00
Evgeny Gerashchenko
53c832d88c
Correctly resolving all references in library source.
...
Added test with stdlib.
Ignoring top-level members from library source to avoid ambiguity. Resolving classes from source when deserializing descriptors (for unification).
2013-09-12 15:24:23 +04:00
Pavel V. Talanov
217312ab78
Continue to look for descriptors if IGNORE_KOTLIN_SOURCES was passed as DescriptorSearchRule
...
Add comment to DesriptorSearchRule explaining why we should get rid of it asap
Remove useless code from DesriptorSearchRule
2013-09-10 13:14:46 +04:00
Alexander Udalov
c0a4d8d24f
Support Class<?> as annotation arguments in java
2013-09-06 23:26:27 +04:00
Alexander Udalov
b8f9ef9910
Extract interface out of TypeVariableResolver
...
Also make getTypeVariable() nullable: when a type is not found, it's better to
use error type instead of throwing an exception
2013-09-06 23:26:26 +04:00
Alexander Udalov
5805598306
Replace hard exceptions with LOG.error
2013-09-06 23:26:26 +04:00
Alexander Udalov
77e0d275db
Remove unreachable code in AnnotationDescriptorDeserializer
...
Kotlin classes should only be discoverable by VirtualFileFinder
2013-09-06 21:28:49 +04:00
Alexander Udalov
9d2add81f8
Don't break the world if enum in annotation isn't found
2013-09-06 21:28:49 +04:00
Alexander Udalov
2b9225fdd4
Extract descriptor.loader.java module from frontend.java
...
Will be used in runtime to load reflected classes
2013-09-04 21:55:11 +04:00