Alexander Udalov
edda5d8801
Move AssertInvisibleInResolver check to frontend.java
...
This is a dirty hack, taking advantage of the fact that
JavaResolverCache.getClass() is called exactly once and right after this check
2013-10-04 18:32:41 +04:00
Alexander Udalov
dbba6c614b
Rename JvmClassName.getFqName() and add a warning
...
All usages of this method as of right now seem wrong, as they don't work in the
case of classes which contain dollars in their names -- dollars get replaced to
dots
2013-10-04 18:32:41 +04:00
Alexander Udalov
e8d4aae48b
Minimize usages of JvmClassName.getFqName()
2013-10-04 18:32:41 +04:00
Alexander Udalov
044a47905e
Get rid of dependency on Guava's Multimap
...
Replace with a hand-written multi-map
2013-10-04 18:32:41 +04:00
Alexander Udalov
3d5e128267
Remove trivial dependencies of JDR on Guava
2013-10-04 18:32:41 +04:00
Alexander Udalov
fc78971aea
Delete JvmClassName.getAsmType()
2013-10-04 18:32:40 +04:00
Alexander Udalov
521496b188
Delete JvmPrimitiveType.getAsmType()
...
Create PrimitiveTypesUtil in frontend.java for this and other utilities
2013-10-04 18:32:40 +04:00
Alexander Udalov
f4abaaee10
Delete JvmClassName.byType
...
Replace JvmClassName by ASM Type in many places of JVM codegen: it wasn't used
to abstract anything, but there was a lot of useless conversions between the
two
2013-10-04 18:32:39 +04:00
Alexander Udalov
6898274f47
Delete JvmClassName.getDescriptor()
...
It shouldn't be available in descriptor.loader.java, since it wouldn't depend
on ASM and its descriptors won't make any sense there. Most of the places where
this method was used were in codegen. The few exceptions are reading
annotations for compiled Kotlin classes by ASM visitors, but that will be
abstracted away soon
2013-10-04 18:32:39 +04:00
Alexander Udalov
45bc7c2926
Delete JvmClassName.byClass, refactor JvmAnnotationNames
...
Store constant class names as instances of FqName instead of JvmClassName. This
is done to minimize usages of the method 'JvmClassName.getFqName()', since it's
wrong and shouldn't be used
2013-10-04 18:32:39 +04:00
Alexander Udalov
6aab9fe04e
Delete JvmClassName.byClassDescriptor
...
It only worked correctly by coincidence: mapping from the Kotlin world to the
JVM world should always be done through JetTypeMapper
2013-10-04 18:32:39 +04:00
Alexander Udalov
54db0e30c0
Delete signature name from JvmClassName
2013-10-04 18:32:39 +04:00
Alexander Udalov
1cb68e9cf4
Move KotlinToJavaTypesMap, AsmTypeConstants to frontend.java
...
They're used only in compiler
2013-10-04 18:32:38 +04:00
Alexander Udalov
73b867d1e5
Simplify JvmPrimitiveType, PrimitiveType
...
Delete utility methods from interfaces, move once-used methods to where they're
used
2013-10-04 18:32:38 +04:00
Alexander Udalov
1578d891cb
Remove PsiClassFinder
...
Inline the implementation into JavaClassFinderImpl
2013-10-04 18:32:38 +04:00
Alexander Udalov
19dd2e5e1b
Create special classes for decompiled Java enums
...
Simplify logic in JavaConstructorResolver and JavaClassResolver
2013-10-04 01:03:34 +04:00
Alexander Udalov
01e46bbd11
Move caching logic from java class scope to descriptor
2013-10-04 01:03:34 +04:00
Andrey Breslav
f3cd83c744
All storage-related code moved to util.runtime
2013-10-03 15:49:18 +04:00
Alexander Udalov
f68a702e8f
Report ABI errors on KotlinClass, not VirtualFile
2013-10-02 17:55:02 +04:00
Alexander Udalov
1afd0504fa
Make compiled package fragments not show up in completion, go-to, etc.
2013-10-02 17:55:02 +04:00
Alexander Udalov
3087c6f584
ReadDataFromAnnotationVisitor doesn't depend on ASM anymore
2013-10-02 17:07:37 +04:00
Alexander Udalov
8b63665b20
Delete getFqName() method from KotlinClassFileHeader
...
It's not related to the header. Add getClassName() method to
KotlinJvmBinaryClass, which reads the internal name of the class
2013-10-02 17:05:50 +04:00
Alexander Udalov
a5a80a9ccc
Change KotlinClassFileHeader loading interface
...
It should be able to load the header based on an abstract KotlinJvmBinaryClass,
not only the VirtualFile-based one
2013-10-02 17:05:50 +04:00
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