Simplify class object naming madness

- get rid of DescriptorNamer, always use descriptor.getName() instead
- delete AbstractClassResolver.getClassObjectName(), always use
  "<class-object-for-...>", except for the case of built-ins serialization
  (class object names should be replaced by "object" when writing files with
  serialized data for built-ins)
- delete NestedClassResolver.resolveClassObject(), always use the other method
  of this class instead
This commit is contained in:
Alexander Udalov
2013-07-01 19:26:38 +04:00
parent 5db2ecd1fc
commit f9ad6827d4
190 changed files with 103 additions and 215 deletions
@@ -41,7 +41,10 @@ import org.jetbrains.jet.codegen.signature.kotlin.JetMethodAnnotationWriter;
import org.jetbrains.jet.codegen.state.GenerationState;
import org.jetbrains.jet.codegen.state.JetTypeMapper;
import org.jetbrains.jet.codegen.state.JetTypeMapperMode;
import org.jetbrains.jet.descriptors.serialization.*;
import org.jetbrains.jet.descriptors.serialization.ClassSerializationUtil;
import org.jetbrains.jet.descriptors.serialization.DescriptorSerializer;
import org.jetbrains.jet.descriptors.serialization.NameSerializationUtil;
import org.jetbrains.jet.descriptors.serialization.ProtoBuf;
import org.jetbrains.jet.lang.descriptors.*;
import org.jetbrains.jet.lang.descriptors.impl.MutableClassDescriptor;
import org.jetbrains.jet.lang.psi.*;
@@ -222,7 +225,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
private void writeKotlinInfo() {
AnnotationVisitor av = v.getVisitor().visitAnnotation(JvmStdlibNames.KOTLIN_INFO_CLASS.getDescriptor(), true);
DescriptorSerializer serializer = new DescriptorSerializer(DescriptorNamer.DEFAULT);
DescriptorSerializer serializer = new DescriptorSerializer();
final ByteArrayOutputStream classStream = new ByteArrayOutputStream();
@@ -32,7 +32,6 @@ import org.jetbrains.jet.lang.descriptors.ClassOrNamespaceDescriptor;
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
import org.jetbrains.jet.lang.resolve.java.JvmAbi;
import org.jetbrains.jet.lang.resolve.java.JvmStdlibNames;
import org.jetbrains.jet.lang.resolve.lazy.storage.LockBasedStorageManager;
@@ -268,7 +267,7 @@ public final class DeserializedDescriptorResolver {
@NotNull
@Override
protected ClassId getClassId(@NotNull ClassDescriptor classDescriptor) {
return ClassSerializationUtil.getClassId(classDescriptor, DescriptorNamer.DEFAULT);
return ClassSerializationUtil.getClassId(classDescriptor);
}
@Nullable
@@ -277,12 +276,6 @@ public final class DeserializedDescriptorResolver {
return javaClassResolver.resolveClass(kotlinFqNameToJavaFqName(classId.asSingleFqName()));
}
@NotNull
@Override
protected Name getClassObjectName(@NotNull ClassDescriptor outerClass) {
return DescriptorUtils.getClassObjectName(outerClass.getName());
}
@Override
protected void classDescriptorCreated(@NotNull ClassDescriptor classDescriptor) {
//nothing to do here
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
 H2
R Â0B
Z Ć0JB
Z Ć0IB

@@ -1,8 +1,8 @@
& L2
& K2

R Ć0B
 Z
0B
Z
&0MB
&0LB

@@ -1,4 +1,4 @@
 O2
 N2
R Â0B
"Z Æ0JB
"Z Ć0IB

@@ -1,8 +1,8 @@
& _2
& ^2

R Ć0B
(Z
0B
Z
&0`B
&0_B

@@ -1,4 +1,4 @@
 b2
 a2
R Â0B
*Z Ć0JB
*Z Æ0IB

Binary file not shown.
@@ -1,7 +1,7 @@
& Ź2
& Ť2

R Ć0B
-Z
0B
Z &0­B
Z &0ŹB

@@ -1,4 +1,4 @@
 Ż2
 ®2
R В0B
/Z Ć0JB
/Z Ж0IB

Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,7 @@
& Ě2
& Ë2

R Ć0B
1Z
0B
Z &0ÍB
Z &0ĚB

@@ -1,4 +1,4 @@
 Ď2
 Î2
R Â0B
3Z Ć0JB
3Z Ć0IB

Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More