Write java signature of serialized descriptors efficiently

Instead of storing a string with the signature, write the name, return type and
parameter types separately, reusing the name table. Refactor the name table to
allow it to store not only names of Kotlin entities, but also arbitrary names
and fq-names
This commit is contained in:
Alexander Udalov
2013-07-11 17:12:01 +04:00
parent eee9bb5a12
commit 453b0e8f10
13 changed files with 1841 additions and 76 deletions
@@ -21,6 +21,42 @@ import "compiler/frontend/serialization/src/descriptors.proto";
option java_outer_classname = "JavaProtoBuf";
option optimize_for = LITE_RUNTIME;
extend Callable {
optional string java_signature = 100;
message JavaType {
enum PrimitiveType {
// These values correspond to ASM Type sorts
VOID = 0;
BOOLEAN = 1;
CHAR = 2;
BYTE = 3;
SHORT = 4;
INT = 5;
FLOAT = 6;
LONG = 7;
DOUBLE = 8;
}
// One of these should be present
optional PrimitiveType primitive_type = 1;
optional int32 class_fq_name = 2;
optional int32 array_dimension = 3 [default = 0];
}
message JavaMethodSignature {
required int32 name = 1;
required JavaType return_type = 2;
repeated JavaType parameter_type = 3;
}
message JavaPropertySignature {
required JavaType type = 1;
optional int32 field_name = 2;
optional JavaMethodSignature getter = 3;
optional JavaMethodSignature setter = 4;
}
extend Callable {
optional JavaMethodSignature method_signature = 100;
optional JavaPropertySignature property_signature = 101;
}