diff --git a/compiler/ir/serialization.common/src/KotlinIr.proto b/compiler/ir/serialization.common/src/KotlinIr.proto
index 8393dbcb3b7..c3625430fa5 100644
--- a/compiler/ir/serialization.common/src/KotlinIr.proto
+++ b/compiler/ir/serialization.common/src/KotlinIr.proto
@@ -9,20 +9,8 @@ message DescriptorReference {
repeated int32 package_fq_name = 1;
repeated int32 class_fq_name = 2;
required int32 name = 3;
- optional UniqId uniq_id = 4;
- optional bool is_getter = 5 [default = false];
- optional bool is_setter = 6 [default = false];
- optional bool is_backing_field = 7 [default = false];
- optional bool is_fake_override = 8 [default = false];
- optional bool is_default_constructor = 9 [default = false];
- optional bool is_enum_entry = 10 [default = false];
- optional bool is_enum_special = 11 [default = false];
- optional bool is_type_parameter = 12 [default = false];
-}
-
-message UniqId {
- required uint64 index = 1;
- required bool isLocal = 2;
+ required int32 flags = 4;
+ optional int64 uniq_id_index = 5;
}
message Coordinates {
diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/DescriptorReferenceFlags.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/DescriptorReferenceFlags.kt
new file mode 100644
index 00000000000..8cf752f470d
--- /dev/null
+++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/DescriptorReferenceFlags.kt
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
+ */
+
+package org.jetbrains.kotlin.backend.common.serialization
+
+
+enum class DescriptorReferenceFlags {
+ IS_FAKE_OVERRIDE,
+ IS_BACKING_FIELD,
+ IS_GETTER,
+ IS_SETTER,
+ IS_DEFAULT_CONSTRUCTOR,
+ IS_ENUM_ENTRY,
+ IS_ENUM_SPECIAL,
+ IS_TYPE_PARAMETER;
+
+ fun encode(isSet: Boolean): Int = if (isSet) 1 shl ordinal else 0
+ fun decode(flags: Int): Boolean = (flags and (1 shl ordinal) != 0)
+}
diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/DeserializeDescriptorReference.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/DeserializeDescriptorReference.kt
index 35ac4d8c9e1..f06f77cdb87 100644
--- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/DeserializeDescriptorReference.kt
+++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/DeserializeDescriptorReference.kt
@@ -89,14 +89,8 @@ abstract class DescriptorReferenceDeserializer(
packageFqName: FqName,
classFqName: FqName,
name: String,
- index: Long?,
- isEnumEntry: Boolean = false,
- isEnumSpecial: Boolean = false,
- isDefaultConstructor: Boolean = false,
- isFakeOverride: Boolean = false,
- isGetter: Boolean = false,
- isSetter: Boolean = false,
- isTypeParameter: Boolean = false
+ flags: Int,
+ index: Long?
): DeclarationDescriptor {
val protoIndex = index
@@ -118,9 +112,9 @@ abstract class DescriptorReferenceDeserializer(
)
) {
if (descriptor is DeserializedClassDescriptor) {
- val uniqId = UniqId(descriptor.getUniqId()!!, false)
+ val uniqId = UniqId(descriptor.getUniqId()!!)
val newKey = uniqId
- val oldKey = UniqId(protoIndex!!, false)
+ val oldKey = UniqId(protoIndex!!)
resolvedForwardDeclarations.put(oldKey, newKey)
} else {
@@ -130,17 +124,17 @@ abstract class DescriptorReferenceDeserializer(
return descriptor
}
- if (isEnumEntry) {
+ if (DescriptorReferenceFlags.IS_ENUM_ENTRY.decode(flags)) {
val memberScope = (clazz as DeserializedClassDescriptor).getUnsubstitutedMemberScope()
return memberScope.getContributedClassifier(Name.identifier(name), NoLookupLocation.FROM_BACKEND)!!
}
- if (isEnumSpecial) {
+ if (DescriptorReferenceFlags.IS_ENUM_SPECIAL.decode(flags)) {
return clazz!!.getStaticScope()
.getContributedFunctions(Name.identifier(name), NoLookupLocation.FROM_BACKEND).single()
}
- if (isTypeParameter) {
+ if (DescriptorReferenceFlags.IS_TYPE_PARAMETER.decode(flags)) {
for (m in (listOfNotNull(clazz) + members)) {
val typeParameters = when (m) {
@@ -162,14 +156,14 @@ abstract class DescriptorReferenceDeserializer(
val membersWithIndices = getMembers(members)
return when {
- isDefaultConstructor -> membersWithIndices.defaultConstructor
+ DescriptorReferenceFlags.IS_DEFAULT_CONSTRUCTOR.decode(flags) -> membersWithIndices.defaultConstructor
else -> {
- val map = if (isFakeOverride) membersWithIndices.realMembers else membersWithIndices.members
+ val map = if (DescriptorReferenceFlags.IS_FAKE_OVERRIDE.decode(flags)) membersWithIndices.realMembers else membersWithIndices.members
map[protoIndex]?.let { member ->
when {
- member is PropertyDescriptor && isSetter -> member.setter!!
- member is PropertyDescriptor && isGetter -> member.getter!!
+ member is PropertyDescriptor && DescriptorReferenceFlags.IS_SETTER.decode(flags) -> member.setter!!
+ member is PropertyDescriptor && DescriptorReferenceFlags.IS_GETTER.decode(flags) -> member.getter!!
else -> member
}
}
diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/KotlinIrLinker.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/KotlinIrLinker.kt
index 9392eb0a10f..0a9f29a548e 100644
--- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/KotlinIrLinker.kt
+++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/KotlinIrLinker.kt
@@ -332,14 +332,8 @@ abstract class KotlinIrLinker(
deserializeFqName(proto.packageFqNameList),
deserializeFqName(proto.classFqNameList),
deserializeString(proto.name),
- if (proto.hasUniqId()) proto.uniqId.index else null,
- isEnumEntry = proto.isEnumEntry,
- isEnumSpecial = proto.isEnumSpecial,
- isDefaultConstructor = proto.isDefaultConstructor,
- isFakeOverride = proto.isFakeOverride,
- isGetter = proto.isGetter,
- isSetter = proto.isSetter,
- isTypeParameter = proto.isTypeParameter
+ proto.flags,
+ if (proto.hasUniqIdIndex()) proto.uniqIdIndex else null
)
override fun deserializeIrSymbol(index: Int): IrSymbol {
diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/SerializeDescriptorReference.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/SerializeDescriptorReference.kt
index 423dbdd1f35..ce433e7d1fd 100644
--- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/SerializeDescriptorReference.kt
+++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/SerializeDescriptorReference.kt
@@ -115,32 +115,18 @@ open class DescriptorReferenceSerializer(
.addAllClassFqName(serializeFqName(classFqName))
.setName(serializeString(nameString))
- if (uniqId != null) proto.setUniqId(protoUniqId(uniqId))
+ val flags = DescriptorReferenceFlags.IS_FAKE_OVERRIDE.encode(isFakeOverride) or
+ DescriptorReferenceFlags.IS_BACKING_FIELD.encode(isBackingField) or
+ DescriptorReferenceFlags.IS_GETTER.encode(declaration.isGetter) or
+ DescriptorReferenceFlags.IS_SETTER.encode(declaration.isSetter) or
+ DescriptorReferenceFlags.IS_DEFAULT_CONSTRUCTOR.encode(isDefaultConstructor) or
+ DescriptorReferenceFlags.IS_ENUM_ENTRY.encode(isEnumEntry) or
+ DescriptorReferenceFlags.IS_ENUM_SPECIAL.encode(isEnumSpecial) or
+ DescriptorReferenceFlags.IS_TYPE_PARAMETER.encode(isTypeParameter)
- if (isFakeOverride) {
- proto.setIsFakeOverride(true)
- }
+ proto.flags = flags
- if (isBackingField) {
- proto.setIsBackingField(true)
- }
-
- if (isAccessor) {
- if (declaration.isGetter)
- proto.setIsGetter(true)
- else if (declaration.isSetter)
- proto.setIsSetter(true)
- else
- error("A property accessor which is neither a getter, nor a setter: $descriptor")
- } else if (isDefaultConstructor) {
- proto.setIsDefaultConstructor(true)
- } else if (isEnumEntry) {
- proto.setIsEnumEntry(true)
- } else if (isEnumSpecial) {
- proto.setIsEnumSpecial(true)
- } else if (isTypeParameter) {
- proto.setIsTypeParameter(true)
- }
+ if (uniqId != null) proto.uniqIdIndex = uniqId.index
return proto.build()
}
diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/DescriptorReference.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/DescriptorReference.java
index cbfd5510e18..1116d0559da 100644
--- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/DescriptorReference.java
+++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/DescriptorReference.java
@@ -100,57 +100,14 @@ public final class DescriptorReference extends
name_ = input.readInt32();
break;
}
- case 34: {
- org.jetbrains.kotlin.backend.common.serialization.proto.UniqId.Builder subBuilder = null;
- if (((bitField0_ & 0x00000002) == 0x00000002)) {
- subBuilder = uniqId_.toBuilder();
- }
- uniqId_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.UniqId.PARSER, extensionRegistry);
- if (subBuilder != null) {
- subBuilder.mergeFrom(uniqId_);
- uniqId_ = subBuilder.buildPartial();
- }
+ case 32: {
bitField0_ |= 0x00000002;
+ flags_ = input.readInt32();
break;
}
case 40: {
bitField0_ |= 0x00000004;
- isGetter_ = input.readBool();
- break;
- }
- case 48: {
- bitField0_ |= 0x00000008;
- isSetter_ = input.readBool();
- break;
- }
- case 56: {
- bitField0_ |= 0x00000010;
- isBackingField_ = input.readBool();
- break;
- }
- case 64: {
- bitField0_ |= 0x00000020;
- isFakeOverride_ = input.readBool();
- break;
- }
- case 72: {
- bitField0_ |= 0x00000040;
- isDefaultConstructor_ = input.readBool();
- break;
- }
- case 80: {
- bitField0_ |= 0x00000080;
- isEnumEntry_ = input.readBool();
- break;
- }
- case 88: {
- bitField0_ |= 0x00000100;
- isEnumSpecial_ = input.readBool();
- break;
- }
- case 96: {
- bitField0_ |= 0x00000200;
- isTypeParameter_ = input.readBool();
+ uniqIdIndex_ = input.readInt64();
break;
}
}
@@ -241,175 +198,53 @@ public final class DescriptorReference extends
private int name_;
/**
* required int32 name = 3;
- *
- *
- * required FqName package_fq_name = 1; - * required FqName class_fq_name = 2; - **/ public boolean hasName() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** *
required int32 name = 3;
- *
- * - * required FqName package_fq_name = 1; - * required FqName class_fq_name = 2; - **/ public int getName() { return name_; } - public static final int UNIQ_ID_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniqId_; + public static final int FLAGS_FIELD_NUMBER = 4; + private int flags_; /** - *
optional .org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniq_id = 4;
+ * required int32 flags = 4;
*/
- public boolean hasUniqId() {
+ public boolean hasFlags() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
- * optional .org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniq_id = 4;
+ * required int32 flags = 4;
*/
- public org.jetbrains.kotlin.backend.common.serialization.proto.UniqId getUniqId() {
- return uniqId_;
+ public int getFlags() {
+ return flags_;
}
- public static final int IS_GETTER_FIELD_NUMBER = 5;
- private boolean isGetter_;
+ public static final int UNIQ_ID_INDEX_FIELD_NUMBER = 5;
+ private long uniqIdIndex_;
/**
- * optional bool is_getter = 5 [default = false];
+ * optional int64 uniq_id_index = 5;
*/
- public boolean hasIsGetter() {
+ public boolean hasUniqIdIndex() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
- * optional bool is_getter = 5 [default = false];
+ * optional int64 uniq_id_index = 5;
*/
- public boolean getIsGetter() {
- return isGetter_;
- }
-
- public static final int IS_SETTER_FIELD_NUMBER = 6;
- private boolean isSetter_;
- /**
- * optional bool is_setter = 6 [default = false];
- */
- public boolean hasIsSetter() {
- return ((bitField0_ & 0x00000008) == 0x00000008);
- }
- /**
- * optional bool is_setter = 6 [default = false];
- */
- public boolean getIsSetter() {
- return isSetter_;
- }
-
- public static final int IS_BACKING_FIELD_FIELD_NUMBER = 7;
- private boolean isBackingField_;
- /**
- * optional bool is_backing_field = 7 [default = false];
- */
- public boolean hasIsBackingField() {
- return ((bitField0_ & 0x00000010) == 0x00000010);
- }
- /**
- * optional bool is_backing_field = 7 [default = false];
- */
- public boolean getIsBackingField() {
- return isBackingField_;
- }
-
- public static final int IS_FAKE_OVERRIDE_FIELD_NUMBER = 8;
- private boolean isFakeOverride_;
- /**
- * optional bool is_fake_override = 8 [default = false];
- */
- public boolean hasIsFakeOverride() {
- return ((bitField0_ & 0x00000020) == 0x00000020);
- }
- /**
- * optional bool is_fake_override = 8 [default = false];
- */
- public boolean getIsFakeOverride() {
- return isFakeOverride_;
- }
-
- public static final int IS_DEFAULT_CONSTRUCTOR_FIELD_NUMBER = 9;
- private boolean isDefaultConstructor_;
- /**
- * optional bool is_default_constructor = 9 [default = false];
- */
- public boolean hasIsDefaultConstructor() {
- return ((bitField0_ & 0x00000040) == 0x00000040);
- }
- /**
- * optional bool is_default_constructor = 9 [default = false];
- */
- public boolean getIsDefaultConstructor() {
- return isDefaultConstructor_;
- }
-
- public static final int IS_ENUM_ENTRY_FIELD_NUMBER = 10;
- private boolean isEnumEntry_;
- /**
- * optional bool is_enum_entry = 10 [default = false];
- */
- public boolean hasIsEnumEntry() {
- return ((bitField0_ & 0x00000080) == 0x00000080);
- }
- /**
- * optional bool is_enum_entry = 10 [default = false];
- */
- public boolean getIsEnumEntry() {
- return isEnumEntry_;
- }
-
- public static final int IS_ENUM_SPECIAL_FIELD_NUMBER = 11;
- private boolean isEnumSpecial_;
- /**
- * optional bool is_enum_special = 11 [default = false];
- */
- public boolean hasIsEnumSpecial() {
- return ((bitField0_ & 0x00000100) == 0x00000100);
- }
- /**
- * optional bool is_enum_special = 11 [default = false];
- */
- public boolean getIsEnumSpecial() {
- return isEnumSpecial_;
- }
-
- public static final int IS_TYPE_PARAMETER_FIELD_NUMBER = 12;
- private boolean isTypeParameter_;
- /**
- * optional bool is_type_parameter = 12 [default = false];
- */
- public boolean hasIsTypeParameter() {
- return ((bitField0_ & 0x00000200) == 0x00000200);
- }
- /**
- * optional bool is_type_parameter = 12 [default = false];
- */
- public boolean getIsTypeParameter() {
- return isTypeParameter_;
+ public long getUniqIdIndex() {
+ return uniqIdIndex_;
}
private void initFields() {
packageFqName_ = java.util.Collections.emptyList();
classFqName_ = java.util.Collections.emptyList();
name_ = 0;
- uniqId_ = org.jetbrains.kotlin.backend.common.serialization.proto.UniqId.getDefaultInstance();
- isGetter_ = false;
- isSetter_ = false;
- isBackingField_ = false;
- isFakeOverride_ = false;
- isDefaultConstructor_ = false;
- isEnumEntry_ = false;
- isEnumSpecial_ = false;
- isTypeParameter_ = false;
+ flags_ = 0;
+ uniqIdIndex_ = 0L;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@@ -421,11 +256,9 @@ public final class DescriptorReference extends
memoizedIsInitialized = 0;
return false;
}
- if (hasUniqId()) {
- if (!getUniqId().isInitialized()) {
- memoizedIsInitialized = 0;
- return false;
- }
+ if (!hasFlags()) {
+ memoizedIsInitialized = 0;
+ return false;
}
memoizedIsInitialized = 1;
return true;
@@ -444,31 +277,10 @@ public final class DescriptorReference extends
output.writeInt32(3, name_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
- output.writeMessage(4, uniqId_);
+ output.writeInt32(4, flags_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
- output.writeBool(5, isGetter_);
- }
- if (((bitField0_ & 0x00000008) == 0x00000008)) {
- output.writeBool(6, isSetter_);
- }
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
- output.writeBool(7, isBackingField_);
- }
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
- output.writeBool(8, isFakeOverride_);
- }
- if (((bitField0_ & 0x00000040) == 0x00000040)) {
- output.writeBool(9, isDefaultConstructor_);
- }
- if (((bitField0_ & 0x00000080) == 0x00000080)) {
- output.writeBool(10, isEnumEntry_);
- }
- if (((bitField0_ & 0x00000100) == 0x00000100)) {
- output.writeBool(11, isEnumSpecial_);
- }
- if (((bitField0_ & 0x00000200) == 0x00000200)) {
- output.writeBool(12, isTypeParameter_);
+ output.writeInt64(5, uniqIdIndex_);
}
output.writeRawBytes(unknownFields);
}
@@ -503,39 +315,11 @@ public final class DescriptorReference extends
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
- .computeMessageSize(4, uniqId_);
+ .computeInt32Size(4, flags_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
- .computeBoolSize(5, isGetter_);
- }
- if (((bitField0_ & 0x00000008) == 0x00000008)) {
- size += org.jetbrains.kotlin.protobuf.CodedOutputStream
- .computeBoolSize(6, isSetter_);
- }
- if (((bitField0_ & 0x00000010) == 0x00000010)) {
- size += org.jetbrains.kotlin.protobuf.CodedOutputStream
- .computeBoolSize(7, isBackingField_);
- }
- if (((bitField0_ & 0x00000020) == 0x00000020)) {
- size += org.jetbrains.kotlin.protobuf.CodedOutputStream
- .computeBoolSize(8, isFakeOverride_);
- }
- if (((bitField0_ & 0x00000040) == 0x00000040)) {
- size += org.jetbrains.kotlin.protobuf.CodedOutputStream
- .computeBoolSize(9, isDefaultConstructor_);
- }
- if (((bitField0_ & 0x00000080) == 0x00000080)) {
- size += org.jetbrains.kotlin.protobuf.CodedOutputStream
- .computeBoolSize(10, isEnumEntry_);
- }
- if (((bitField0_ & 0x00000100) == 0x00000100)) {
- size += org.jetbrains.kotlin.protobuf.CodedOutputStream
- .computeBoolSize(11, isEnumSpecial_);
- }
- if (((bitField0_ & 0x00000200) == 0x00000200)) {
- size += org.jetbrains.kotlin.protobuf.CodedOutputStream
- .computeBoolSize(12, isTypeParameter_);
+ .computeInt64Size(5, uniqIdIndex_);
}
size += unknownFields.size();
memoizedSerializedSize = size;
@@ -637,24 +421,10 @@ public final class DescriptorReference extends
bitField0_ = (bitField0_ & ~0x00000002);
name_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
- uniqId_ = org.jetbrains.kotlin.backend.common.serialization.proto.UniqId.getDefaultInstance();
+ flags_ = 0;
bitField0_ = (bitField0_ & ~0x00000008);
- isGetter_ = false;
+ uniqIdIndex_ = 0L;
bitField0_ = (bitField0_ & ~0x00000010);
- isSetter_ = false;
- bitField0_ = (bitField0_ & ~0x00000020);
- isBackingField_ = false;
- bitField0_ = (bitField0_ & ~0x00000040);
- isFakeOverride_ = false;
- bitField0_ = (bitField0_ & ~0x00000080);
- isDefaultConstructor_ = false;
- bitField0_ = (bitField0_ & ~0x00000100);
- isEnumEntry_ = false;
- bitField0_ = (bitField0_ & ~0x00000200);
- isEnumSpecial_ = false;
- bitField0_ = (bitField0_ & ~0x00000400);
- isTypeParameter_ = false;
- bitField0_ = (bitField0_ & ~0x00000800);
return this;
}
@@ -695,39 +465,11 @@ public final class DescriptorReference extends
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000002;
}
- result.uniqId_ = uniqId_;
+ result.flags_ = flags_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000004;
}
- result.isGetter_ = isGetter_;
- if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
- to_bitField0_ |= 0x00000008;
- }
- result.isSetter_ = isSetter_;
- if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
- to_bitField0_ |= 0x00000010;
- }
- result.isBackingField_ = isBackingField_;
- if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
- to_bitField0_ |= 0x00000020;
- }
- result.isFakeOverride_ = isFakeOverride_;
- if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
- to_bitField0_ |= 0x00000040;
- }
- result.isDefaultConstructor_ = isDefaultConstructor_;
- if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
- to_bitField0_ |= 0x00000080;
- }
- result.isEnumEntry_ = isEnumEntry_;
- if (((from_bitField0_ & 0x00000400) == 0x00000400)) {
- to_bitField0_ |= 0x00000100;
- }
- result.isEnumSpecial_ = isEnumSpecial_;
- if (((from_bitField0_ & 0x00000800) == 0x00000800)) {
- to_bitField0_ |= 0x00000200;
- }
- result.isTypeParameter_ = isTypeParameter_;
+ result.uniqIdIndex_ = uniqIdIndex_;
result.bitField0_ = to_bitField0_;
return result;
}
@@ -757,32 +499,11 @@ public final class DescriptorReference extends
if (other.hasName()) {
setName(other.getName());
}
- if (other.hasUniqId()) {
- mergeUniqId(other.getUniqId());
+ if (other.hasFlags()) {
+ setFlags(other.getFlags());
}
- if (other.hasIsGetter()) {
- setIsGetter(other.getIsGetter());
- }
- if (other.hasIsSetter()) {
- setIsSetter(other.getIsSetter());
- }
- if (other.hasIsBackingField()) {
- setIsBackingField(other.getIsBackingField());
- }
- if (other.hasIsFakeOverride()) {
- setIsFakeOverride(other.getIsFakeOverride());
- }
- if (other.hasIsDefaultConstructor()) {
- setIsDefaultConstructor(other.getIsDefaultConstructor());
- }
- if (other.hasIsEnumEntry()) {
- setIsEnumEntry(other.getIsEnumEntry());
- }
- if (other.hasIsEnumSpecial()) {
- setIsEnumSpecial(other.getIsEnumSpecial());
- }
- if (other.hasIsTypeParameter()) {
- setIsTypeParameter(other.getIsTypeParameter());
+ if (other.hasUniqIdIndex()) {
+ setUniqIdIndex(other.getUniqIdIndex());
}
setUnknownFields(
getUnknownFields().concat(other.unknownFields));
@@ -794,11 +515,9 @@ public final class DescriptorReference extends
return false;
}
- if (hasUniqId()) {
- if (!getUniqId().isInitialized()) {
-
- return false;
- }
+ if (!hasFlags()) {
+
+ return false;
}
return true;
}
@@ -957,33 +676,18 @@ public final class DescriptorReference extends
private int name_ ;
/**
* required int32 name = 3;
- *
- * - * required FqName package_fq_name = 1; - * required FqName class_fq_name = 2; - **/ public boolean hasName() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** *
required int32 name = 3;
- *
- * - * required FqName package_fq_name = 1; - * required FqName class_fq_name = 2; - **/ public int getName() { return name_; } /** *
required int32 name = 3;
- *
- * - * required FqName package_fq_name = 1; - * required FqName class_fq_name = 2; - **/ public Builder setName(int value) { bitField0_ |= 0x00000004; @@ -993,11 +697,6 @@ public final class DescriptorReference extends } /** *
required int32 name = 3;
- *
- * - * required FqName package_fq_name = 1; - * required FqName class_fq_name = 2; - **/ public Builder clearName() { bitField0_ = (bitField0_ & ~0x00000004); @@ -1006,318 +705,66 @@ public final class DescriptorReference extends return this; } - private org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniqId_ = org.jetbrains.kotlin.backend.common.serialization.proto.UniqId.getDefaultInstance(); + private int flags_ ; /** - *
optional .org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniq_id = 4;
+ * required int32 flags = 4;
*/
- public boolean hasUniqId() {
+ public boolean hasFlags() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
- * optional .org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniq_id = 4;
+ * required int32 flags = 4;
*/
- public org.jetbrains.kotlin.backend.common.serialization.proto.UniqId getUniqId() {
- return uniqId_;
+ public int getFlags() {
+ return flags_;
}
/**
- * optional .org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniq_id = 4;
+ * required int32 flags = 4;
*/
- public Builder setUniqId(org.jetbrains.kotlin.backend.common.serialization.proto.UniqId value) {
- if (value == null) {
- throw new NullPointerException();
- }
- uniqId_ = value;
-
+ public Builder setFlags(int value) {
bitField0_ |= 0x00000008;
+ flags_ = value;
+
return this;
}
/**
- * optional .org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniq_id = 4;
+ * required int32 flags = 4;
*/
- public Builder setUniqId(
- org.jetbrains.kotlin.backend.common.serialization.proto.UniqId.Builder builderForValue) {
- uniqId_ = builderForValue.build();
-
- bitField0_ |= 0x00000008;
- return this;
- }
- /**
- * optional .org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniq_id = 4;
- */
- public Builder mergeUniqId(org.jetbrains.kotlin.backend.common.serialization.proto.UniqId value) {
- if (((bitField0_ & 0x00000008) == 0x00000008) &&
- uniqId_ != org.jetbrains.kotlin.backend.common.serialization.proto.UniqId.getDefaultInstance()) {
- uniqId_ =
- org.jetbrains.kotlin.backend.common.serialization.proto.UniqId.newBuilder(uniqId_).mergeFrom(value).buildPartial();
- } else {
- uniqId_ = value;
- }
-
- bitField0_ |= 0x00000008;
- return this;
- }
- /**
- * optional .org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniq_id = 4;
- */
- public Builder clearUniqId() {
- uniqId_ = org.jetbrains.kotlin.backend.common.serialization.proto.UniqId.getDefaultInstance();
-
+ public Builder clearFlags() {
bitField0_ = (bitField0_ & ~0x00000008);
+ flags_ = 0;
+
return this;
}
- private boolean isGetter_ ;
+ private long uniqIdIndex_ ;
/**
- * optional bool is_getter = 5 [default = false];
+ * optional int64 uniq_id_index = 5;
*/
- public boolean hasIsGetter() {
+ public boolean hasUniqIdIndex() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
- * optional bool is_getter = 5 [default = false];
+ * optional int64 uniq_id_index = 5;
*/
- public boolean getIsGetter() {
- return isGetter_;
+ public long getUniqIdIndex() {
+ return uniqIdIndex_;
}
/**
- * optional bool is_getter = 5 [default = false];
+ * optional int64 uniq_id_index = 5;
*/
- public Builder setIsGetter(boolean value) {
+ public Builder setUniqIdIndex(long value) {
bitField0_ |= 0x00000010;
- isGetter_ = value;
+ uniqIdIndex_ = value;
return this;
}
/**
- * optional bool is_getter = 5 [default = false];
+ * optional int64 uniq_id_index = 5;
*/
- public Builder clearIsGetter() {
+ public Builder clearUniqIdIndex() {
bitField0_ = (bitField0_ & ~0x00000010);
- isGetter_ = false;
-
- return this;
- }
-
- private boolean isSetter_ ;
- /**
- * optional bool is_setter = 6 [default = false];
- */
- public boolean hasIsSetter() {
- return ((bitField0_ & 0x00000020) == 0x00000020);
- }
- /**
- * optional bool is_setter = 6 [default = false];
- */
- public boolean getIsSetter() {
- return isSetter_;
- }
- /**
- * optional bool is_setter = 6 [default = false];
- */
- public Builder setIsSetter(boolean value) {
- bitField0_ |= 0x00000020;
- isSetter_ = value;
-
- return this;
- }
- /**
- * optional bool is_setter = 6 [default = false];
- */
- public Builder clearIsSetter() {
- bitField0_ = (bitField0_ & ~0x00000020);
- isSetter_ = false;
-
- return this;
- }
-
- private boolean isBackingField_ ;
- /**
- * optional bool is_backing_field = 7 [default = false];
- */
- public boolean hasIsBackingField() {
- return ((bitField0_ & 0x00000040) == 0x00000040);
- }
- /**
- * optional bool is_backing_field = 7 [default = false];
- */
- public boolean getIsBackingField() {
- return isBackingField_;
- }
- /**
- * optional bool is_backing_field = 7 [default = false];
- */
- public Builder setIsBackingField(boolean value) {
- bitField0_ |= 0x00000040;
- isBackingField_ = value;
-
- return this;
- }
- /**
- * optional bool is_backing_field = 7 [default = false];
- */
- public Builder clearIsBackingField() {
- bitField0_ = (bitField0_ & ~0x00000040);
- isBackingField_ = false;
-
- return this;
- }
-
- private boolean isFakeOverride_ ;
- /**
- * optional bool is_fake_override = 8 [default = false];
- */
- public boolean hasIsFakeOverride() {
- return ((bitField0_ & 0x00000080) == 0x00000080);
- }
- /**
- * optional bool is_fake_override = 8 [default = false];
- */
- public boolean getIsFakeOverride() {
- return isFakeOverride_;
- }
- /**
- * optional bool is_fake_override = 8 [default = false];
- */
- public Builder setIsFakeOverride(boolean value) {
- bitField0_ |= 0x00000080;
- isFakeOverride_ = value;
-
- return this;
- }
- /**
- * optional bool is_fake_override = 8 [default = false];
- */
- public Builder clearIsFakeOverride() {
- bitField0_ = (bitField0_ & ~0x00000080);
- isFakeOverride_ = false;
-
- return this;
- }
-
- private boolean isDefaultConstructor_ ;
- /**
- * optional bool is_default_constructor = 9 [default = false];
- */
- public boolean hasIsDefaultConstructor() {
- return ((bitField0_ & 0x00000100) == 0x00000100);
- }
- /**
- * optional bool is_default_constructor = 9 [default = false];
- */
- public boolean getIsDefaultConstructor() {
- return isDefaultConstructor_;
- }
- /**
- * optional bool is_default_constructor = 9 [default = false];
- */
- public Builder setIsDefaultConstructor(boolean value) {
- bitField0_ |= 0x00000100;
- isDefaultConstructor_ = value;
-
- return this;
- }
- /**
- * optional bool is_default_constructor = 9 [default = false];
- */
- public Builder clearIsDefaultConstructor() {
- bitField0_ = (bitField0_ & ~0x00000100);
- isDefaultConstructor_ = false;
-
- return this;
- }
-
- private boolean isEnumEntry_ ;
- /**
- * optional bool is_enum_entry = 10 [default = false];
- */
- public boolean hasIsEnumEntry() {
- return ((bitField0_ & 0x00000200) == 0x00000200);
- }
- /**
- * optional bool is_enum_entry = 10 [default = false];
- */
- public boolean getIsEnumEntry() {
- return isEnumEntry_;
- }
- /**
- * optional bool is_enum_entry = 10 [default = false];
- */
- public Builder setIsEnumEntry(boolean value) {
- bitField0_ |= 0x00000200;
- isEnumEntry_ = value;
-
- return this;
- }
- /**
- * optional bool is_enum_entry = 10 [default = false];
- */
- public Builder clearIsEnumEntry() {
- bitField0_ = (bitField0_ & ~0x00000200);
- isEnumEntry_ = false;
-
- return this;
- }
-
- private boolean isEnumSpecial_ ;
- /**
- * optional bool is_enum_special = 11 [default = false];
- */
- public boolean hasIsEnumSpecial() {
- return ((bitField0_ & 0x00000400) == 0x00000400);
- }
- /**
- * optional bool is_enum_special = 11 [default = false];
- */
- public boolean getIsEnumSpecial() {
- return isEnumSpecial_;
- }
- /**
- * optional bool is_enum_special = 11 [default = false];
- */
- public Builder setIsEnumSpecial(boolean value) {
- bitField0_ |= 0x00000400;
- isEnumSpecial_ = value;
-
- return this;
- }
- /**
- * optional bool is_enum_special = 11 [default = false];
- */
- public Builder clearIsEnumSpecial() {
- bitField0_ = (bitField0_ & ~0x00000400);
- isEnumSpecial_ = false;
-
- return this;
- }
-
- private boolean isTypeParameter_ ;
- /**
- * optional bool is_type_parameter = 12 [default = false];
- */
- public boolean hasIsTypeParameter() {
- return ((bitField0_ & 0x00000800) == 0x00000800);
- }
- /**
- * optional bool is_type_parameter = 12 [default = false];
- */
- public boolean getIsTypeParameter() {
- return isTypeParameter_;
- }
- /**
- * optional bool is_type_parameter = 12 [default = false];
- */
- public Builder setIsTypeParameter(boolean value) {
- bitField0_ |= 0x00000800;
- isTypeParameter_ = value;
-
- return this;
- }
- /**
- * optional bool is_type_parameter = 12 [default = false];
- */
- public Builder clearIsTypeParameter() {
- bitField0_ = (bitField0_ & ~0x00000800);
- isTypeParameter_ = false;
+ uniqIdIndex_ = 0L;
return this;
}
diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/DescriptorReferenceOrBuilder.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/DescriptorReferenceOrBuilder.java
index 1de3073eefd..5cd429036d6 100644
--- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/DescriptorReferenceOrBuilder.java
+++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/DescriptorReferenceOrBuilder.java
@@ -35,101 +35,28 @@ public interface DescriptorReferenceOrBuilder extends
/**
* required int32 name = 3;
- *
- * - * required FqName package_fq_name = 1; - * required FqName class_fq_name = 2; - **/ boolean hasName(); /** *
required int32 name = 3;
- *
- * - * required FqName package_fq_name = 1; - * required FqName class_fq_name = 2; - **/ int getName(); /** - *
optional .org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniq_id = 4;
+ * required int32 flags = 4;
*/
- boolean hasUniqId();
+ boolean hasFlags();
/**
- * optional .org.jetbrains.kotlin.backend.common.serialization.proto.UniqId uniq_id = 4;
+ * required int32 flags = 4;
*/
- org.jetbrains.kotlin.backend.common.serialization.proto.UniqId getUniqId();
+ int getFlags();
/**
- * optional bool is_getter = 5 [default = false];
+ * optional int64 uniq_id_index = 5;
*/
- boolean hasIsGetter();
+ boolean hasUniqIdIndex();
/**
- * optional bool is_getter = 5 [default = false];
+ * optional int64 uniq_id_index = 5;
*/
- boolean getIsGetter();
-
- /**
- * optional bool is_setter = 6 [default = false];
- */
- boolean hasIsSetter();
- /**
- * optional bool is_setter = 6 [default = false];
- */
- boolean getIsSetter();
-
- /**
- * optional bool is_backing_field = 7 [default = false];
- */
- boolean hasIsBackingField();
- /**
- * optional bool is_backing_field = 7 [default = false];
- */
- boolean getIsBackingField();
-
- /**
- * optional bool is_fake_override = 8 [default = false];
- */
- boolean hasIsFakeOverride();
- /**
- * optional bool is_fake_override = 8 [default = false];
- */
- boolean getIsFakeOverride();
-
- /**
- * optional bool is_default_constructor = 9 [default = false];
- */
- boolean hasIsDefaultConstructor();
- /**
- * optional bool is_default_constructor = 9 [default = false];
- */
- boolean getIsDefaultConstructor();
-
- /**
- * optional bool is_enum_entry = 10 [default = false];
- */
- boolean hasIsEnumEntry();
- /**
- * optional bool is_enum_entry = 10 [default = false];
- */
- boolean getIsEnumEntry();
-
- /**
- * optional bool is_enum_special = 11 [default = false];
- */
- boolean hasIsEnumSpecial();
- /**
- * optional bool is_enum_special = 11 [default = false];
- */
- boolean getIsEnumSpecial();
-
- /**
- * optional bool is_type_parameter = 12 [default = false];
- */
- boolean hasIsTypeParameter();
- /**
- * optional bool is_type_parameter = 12 [default = false];
- */
- boolean getIsTypeParameter();
+ long getUniqIdIndex();
}
\ No newline at end of file