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%)
This commit is contained in:
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.serialization;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
|
||||
import java.io.OutputStream;
|
||||
|
||||
@@ -27,7 +26,5 @@ public interface StringTable {
|
||||
|
||||
int getFqNameIndex(@NotNull ClassDescriptor descriptor);
|
||||
|
||||
int getFqNameIndex(@NotNull FqName fqName);
|
||||
|
||||
void serializeTo(@NotNull OutputStream output);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class StringTableImpl implements StringTable {
|
||||
shortName = descriptor.getName().asString();
|
||||
FqName packageFqName = ((PackageFragmentDescriptor) containingDeclaration).getFqName();
|
||||
if (!packageFqName.isRoot()) {
|
||||
builder.setParentQualifiedName(getFqNameIndex(packageFqName));
|
||||
builder.setParentQualifiedName(getPackageFqNameIndex(packageFqName));
|
||||
}
|
||||
}
|
||||
else if (containingDeclaration instanceof ClassDescriptor) {
|
||||
@@ -109,8 +109,7 @@ public class StringTableImpl implements StringTable {
|
||||
return qualifiedNames.intern(new FqNameProto(builder));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFqNameIndex(@NotNull FqName fqName) {
|
||||
private int getPackageFqNameIndex(@NotNull FqName fqName) {
|
||||
int result = -1;
|
||||
for (Name segment : fqName.pathSegments()) {
|
||||
QualifiedName.Builder builder = QualifiedName.newBuilder();
|
||||
|
||||
Reference in New Issue
Block a user