KLIB: changes in the .proto and linker required for the JS IC
The original behaviour is preserved. All changes should be behind the flags.
This commit is contained in:
committed by
teamcityserver
parent
002f4210f7
commit
3833c833ef
@@ -451,9 +451,9 @@ message IrOperation {
|
||||
IrErrorExpression error_expression = 34;
|
||||
IrErrorCallExpression error_call_expression = 35;
|
||||
|
||||
IrRawFunctionReference raw_function_reference = 36;
|
||||
IrReturnableBlock returnable_block = 37;
|
||||
IrReturnableBlockReturn returnable_block_return = 38;
|
||||
IrRawFunctionReference raw_function_reference = 136;
|
||||
IrReturnableBlock returnable_block = 137;
|
||||
IrReturnableBlockReturn returnable_block_return = 138;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@ message IrField {
|
||||
message IrLocalDelegatedProperty {
|
||||
required IrDeclarationBase base = 1;
|
||||
required int64 name_type = 2;
|
||||
required IrVariable delegate = 3;
|
||||
optional IrVariable delegate = 3;
|
||||
optional IrFunction getter = 4;
|
||||
optional IrFunction setter = 5;
|
||||
}
|
||||
@@ -545,15 +545,15 @@ message IrValueParameter {
|
||||
required int64 name_type = 2;
|
||||
optional int32 vararg_element_type = 3;
|
||||
optional int32 default_value = 4;
|
||||
optional int32 index = 5;
|
||||
optional int32 index = 105;
|
||||
}
|
||||
|
||||
message IrTypeParameter {
|
||||
required IrDeclarationBase base = 1;
|
||||
required int32 name = 2;
|
||||
repeated int32 super_type = 3 [packed=true];
|
||||
optional int32 index = 4;
|
||||
optional bool isGlobal = 5;
|
||||
optional int32 index = 104;
|
||||
optional bool isGlobal = 105;
|
||||
}
|
||||
|
||||
message IrClass {
|
||||
|
||||
+6
-3
@@ -42,9 +42,11 @@ class FakeOverrideGlobalDeclarationTable(
|
||||
|
||||
open class FakeOverrideDeclarationTable(
|
||||
mangler: KotlinMangler.IrMangler,
|
||||
signatureSerializerFactory: (PublicIdSignatureComputer, DeclarationTable) -> IdSignatureSerializer,
|
||||
globalTable: FakeOverrideGlobalDeclarationTable = FakeOverrideGlobalDeclarationTable(mangler)
|
||||
) : DeclarationTable(globalTable) {
|
||||
override val globalDeclarationTable: FakeOverrideGlobalDeclarationTable = globalTable
|
||||
override val signaturer: IdSignatureSerializer = signatureSerializerFactory(globalTable.publicIdSignatureComputer, this)
|
||||
fun clear() {
|
||||
this.table.clear()
|
||||
globalDeclarationTable.clear()
|
||||
@@ -69,15 +71,16 @@ class FakeOverrideBuilder(
|
||||
val symbolTable: SymbolTable,
|
||||
mangler: KotlinMangler.IrMangler,
|
||||
typeSystem: IrTypeSystemContext,
|
||||
irBuiltIns: IrBuiltIns,
|
||||
val platformSpecificClassFilter: FakeOverrideClassFilter = DefaultFakeOverrideClassFilter,
|
||||
// TODO: The declaration table is needed for the signaturer.
|
||||
private val fakeOverrideDeclarationTable: DeclarationTable = FakeOverrideDeclarationTable(mangler),
|
||||
val signatureSerializerFactory: (PublicIdSignatureComputer, DeclarationTable) -> IdSignatureSerializer = ::IdSignatureSerializer,
|
||||
) : FakeOverrideBuilderStrategy() {
|
||||
private val haveFakeOverrides = mutableSetOf<IrClass>()
|
||||
|
||||
private val irOverridingUtil = IrOverridingUtil(typeSystem, this)
|
||||
|
||||
// private class CompatibilityMode(val oldSignatures: Boolean)
|
||||
// TODO: The declaration table is needed for the signaturer.
|
||||
private val fakeOverrideDeclarationTable = FakeOverrideDeclarationTable(mangler, signatureSerializerFactory)
|
||||
|
||||
private val fakeOverrideCandidates = mutableMapOf<IrClass, CompatibilityMode>()
|
||||
fun enqueueClass(clazz: IrClass, signature: IdSignature, compatibilityMode: CompatibilityMode) {
|
||||
|
||||
+7
-1
@@ -27,7 +27,8 @@ abstract class BasicIrModuleDeserializer(
|
||||
override val klib: IrLibrary,
|
||||
override val strategy: DeserializationStrategy,
|
||||
libraryAbiVersion: KotlinAbiVersion,
|
||||
private val containsErrorCode: Boolean = false
|
||||
private val containsErrorCode: Boolean = false,
|
||||
private val useGlobalSignatures: Boolean = false,
|
||||
) :
|
||||
IrModuleDeserializer(moduleDescriptor, libraryAbiVersion) {
|
||||
|
||||
@@ -41,6 +42,10 @@ abstract class BasicIrModuleDeserializer(
|
||||
moduleDescriptor.allDependencyModules.filter { it != moduleDescriptor }.map { linker.resolveModuleDeserializer(it, null) }
|
||||
}
|
||||
|
||||
override fun fileDeserializers(): Collection<IrFileDeserializer> {
|
||||
return fileToDeserializerMap.values
|
||||
}
|
||||
|
||||
override fun init(delegate: IrModuleDeserializer) {
|
||||
val fileCount = klib.fileCount()
|
||||
|
||||
@@ -114,6 +119,7 @@ abstract class BasicIrModuleDeserializer(
|
||||
allowErrorNodes,
|
||||
strategy.inlineBodies,
|
||||
moduleDeserializer,
|
||||
useGlobalSignatures,
|
||||
linker::handleNoModuleDeserializerFound,
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ open class DeclarationTable(globalTable: GlobalDeclarationTable) {
|
||||
return table.getOrPut(declaration) { builder() }
|
||||
}
|
||||
|
||||
fun signatureByDeclaration(declaration: IrDeclaration, compatibleMode: Boolean): IdSignature {
|
||||
open fun signatureByDeclaration(declaration: IrDeclaration, compatibleMode: Boolean): IdSignature {
|
||||
return computeSignatureByDeclaration(declaration, compatibleMode)
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -155,4 +155,8 @@ class CurrentModuleWithICDeserializer(
|
||||
get() = delegate.moduleDependencies
|
||||
override val isCurrent: Boolean
|
||||
get() = delegate.isCurrent
|
||||
|
||||
override fun fileDeserializers(): Collection<IrFileDeserializer> {
|
||||
return delegate.fileDeserializers()
|
||||
}
|
||||
}
|
||||
+6
-3
@@ -81,7 +81,7 @@ class IrBodyDeserializer(
|
||||
private val fileReader: IrLibraryFile,
|
||||
private val declarationDeserializer: IrDeclarationDeserializer,
|
||||
private val statementOriginIndex: Map<String, IrStatementOrigin>,
|
||||
private val allowErrorStatementOrigins: Boolean,
|
||||
private val allowErrorStatementOrigins: Boolean, // TODO: support InlinerExpressionLocationHint
|
||||
) {
|
||||
|
||||
private val fileLoops = mutableMapOf<Int, IrLoop>()
|
||||
@@ -174,7 +174,10 @@ class IrBodyDeserializer(
|
||||
}
|
||||
}
|
||||
|
||||
private fun cntToReturnableBlockSymbol(upCnt: Int) = returnableBlockStack[returnableBlockStack.size - upCnt]
|
||||
private fun cntToReturnableBlockSymbol(upCnt: Int) = if (upCnt > returnableBlockStack.size) {
|
||||
// TODO: fix lowerings
|
||||
IrReturnableBlockSymbolImpl()
|
||||
} else returnableBlockStack[returnableBlockStack.size - upCnt]
|
||||
|
||||
private fun deserializeReturnableBlock(proto: ProtoReturnableBlock, start: Int, end: Int, type: IrType): IrReturnableBlock {
|
||||
|
||||
@@ -204,7 +207,7 @@ class IrBodyDeserializer(
|
||||
}
|
||||
|
||||
proto.typeArgumentList.mapIndexed { i, arg ->
|
||||
access.putTypeArgument(i, declarationDeserializer.deserializeIrType(arg))
|
||||
access.putTypeArgument(i, declarationDeserializer.deserializeNullableIrType(arg))
|
||||
}
|
||||
|
||||
if (proto.hasDispatchReceiver()) {
|
||||
|
||||
+34
-12
@@ -70,7 +70,8 @@ class IrDeclarationDeserializer(
|
||||
private val skipMutableState: Boolean = false,
|
||||
additionalStatementOriginIndex: Map<String, IrStatementOrigin> = emptyMap(),
|
||||
allowErrorStatementOrigins: Boolean = false,
|
||||
private val compatibilityMode: CompatibilityMode
|
||||
private val compatibilityMode: CompatibilityMode,
|
||||
private val allowRedeclaration: Boolean = false
|
||||
) {
|
||||
|
||||
val bodyDeserializer = IrBodyDeserializer(builtIns, allowErrorNodes, irFactory, fileReader, this, statementOriginIndex + additionalStatementOriginIndex, allowErrorStatementOrigins)
|
||||
@@ -89,6 +90,8 @@ class IrDeclarationDeserializer(
|
||||
return ProtoType.parseFrom(readType(index), ExtensionRegistryLite.newInstance())
|
||||
}
|
||||
|
||||
fun deserializeNullableIrType(index: Int): IrType? = if (index == -1) null else deserializeIrType(index)
|
||||
|
||||
fun deserializeIrType(index: Int): IrType {
|
||||
return irTypeCache.getOrPut(index) {
|
||||
val typeData = loadTypeProto(index)
|
||||
@@ -221,7 +224,10 @@ class IrDeclarationDeserializer(
|
||||
coordinates.startOffset, coordinates.endOffset,
|
||||
deserializeIrDeclarationOrigin(proto.originName), proto.flags
|
||||
)
|
||||
result.annotations = deserializeAnnotations(proto.annotationList)
|
||||
// avoid duplicate annotations for local variables
|
||||
if (!allowRedeclaration || result.annotations.isEmpty()) {
|
||||
result.annotations = deserializeAnnotations(proto.annotationList)
|
||||
}
|
||||
if (!skipMutableState) {
|
||||
result.parent = currentParent
|
||||
}
|
||||
@@ -296,6 +302,8 @@ class IrDeclarationDeserializer(
|
||||
withDeserializedIrDeclarationBase(proto.base) { symbol, signature, startOffset, endOffset, origin, fcode ->
|
||||
val flags = ClassFlags.decode(fcode)
|
||||
|
||||
if (allowRedeclaration && symbol.isBound) return symbol.owner as IrClass
|
||||
|
||||
symbolTable.declareClass(signature, { symbol as IrClassSymbol }) {
|
||||
irFactory.createClass(
|
||||
startOffset, endOffset, origin,
|
||||
@@ -532,6 +540,7 @@ class IrDeclarationDeserializer(
|
||||
internal fun deserializeIrFunction(proto: ProtoFunction): IrSimpleFunction {
|
||||
return withDeserializedIrFunctionBase(proto.base) { symbol, idSig, startOffset, endOffset, origin, fcode ->
|
||||
val flags = FunctionFlags.decode(fcode)
|
||||
if (allowRedeclaration && symbol.isBound) return symbol.owner as IrSimpleFunction
|
||||
symbolTable.declareSimpleFunction(idSig, { symbol as IrSimpleFunctionSymbol }) {
|
||||
val nameType = BinaryNameAndType.decode(proto.base.nameType)
|
||||
irFactory.createFunction(
|
||||
@@ -560,7 +569,7 @@ class IrDeclarationDeserializer(
|
||||
withDeserializedIrDeclarationBase(proto.base) { symbol, _, startOffset, endOffset, origin, fcode ->
|
||||
val flags = LocalVariableFlags.decode(fcode)
|
||||
val nameType = BinaryNameAndType.decode(proto.nameType)
|
||||
IrVariableImpl(
|
||||
(if (allowRedeclaration && symbol.isBound) symbol.owner as IrVariable else IrVariableImpl(
|
||||
startOffset, endOffset, origin,
|
||||
symbol as IrVariableSymbol,
|
||||
deserializeName(nameType.nameIndex),
|
||||
@@ -568,7 +577,7 @@ class IrDeclarationDeserializer(
|
||||
flags.isVar,
|
||||
flags.isConst,
|
||||
flags.isLateinit
|
||||
).apply {
|
||||
)).apply {
|
||||
if (proto.hasInitializer())
|
||||
initializer = bodyDeserializer.deserializeExpression(proto.initializer)
|
||||
}
|
||||
@@ -622,7 +631,8 @@ class IrDeclarationDeserializer(
|
||||
val nameType = BinaryNameAndType.decode(proto.nameType)
|
||||
val type = deserializeIrType(nameType.typeIndex)
|
||||
val flags = FieldFlags.decode(fcode)
|
||||
symbolTable.declareField(uniqId, { symbol }) {
|
||||
|
||||
val field = if (allowRedeclaration && symbol.isBound) symbol.owner else symbolTable.declareField(uniqId, { symbol }) {
|
||||
irFactory.createField(
|
||||
startOffset, endOffset, origin,
|
||||
it,
|
||||
@@ -633,40 +643,48 @@ class IrDeclarationDeserializer(
|
||||
flags.isExternal || isEffectivelyExternal,
|
||||
flags.isStatic,
|
||||
)
|
||||
}.usingParent {
|
||||
}
|
||||
|
||||
field.usingParent {
|
||||
if (proto.hasInitializer()) {
|
||||
withInitializerGuard {
|
||||
initializer = deserializeExpressionBody(proto.initializer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
field
|
||||
}
|
||||
|
||||
private fun deserializeIrLocalDelegatedProperty(proto: ProtoLocalDelegatedProperty): IrLocalDelegatedProperty =
|
||||
withDeserializedIrDeclarationBase(proto.base) { symbol, _, startOffset, endOffset, origin, fcode ->
|
||||
val flags = LocalVariableFlags.decode(fcode)
|
||||
val nameAndType = BinaryNameAndType.decode(proto.nameType)
|
||||
irFactory.createLocalDelegatedProperty(
|
||||
val prop = if (allowRedeclaration && symbol.isBound) symbol.owner as IrLocalDelegatedProperty else irFactory.createLocalDelegatedProperty(
|
||||
startOffset, endOffset, origin,
|
||||
symbol as IrLocalDelegatedPropertySymbol,
|
||||
deserializeName(nameAndType.nameIndex),
|
||||
deserializeIrType(nameAndType.typeIndex),
|
||||
flags.isVar
|
||||
).apply {
|
||||
if (!skipMutableState) {
|
||||
)
|
||||
|
||||
if (!skipMutableState) {
|
||||
prop.apply {
|
||||
delegate = deserializeIrVariable(proto.delegate)
|
||||
getter = deserializeIrFunction(proto.getter)
|
||||
if (proto.hasSetter())
|
||||
setter = deserializeIrFunction(proto.setter)
|
||||
}
|
||||
}
|
||||
|
||||
prop
|
||||
}
|
||||
|
||||
private fun deserializeIrProperty(proto: ProtoProperty): IrProperty =
|
||||
withDeserializedIrDeclarationBase(proto.base) { symbol, uniqId, startOffset, endOffset, origin, fcode ->
|
||||
require(symbol is IrPropertySymbol)
|
||||
val flags = PropertyFlags.decode(fcode)
|
||||
symbolTable.declareProperty(uniqId, { symbol }) {
|
||||
val prop = if (allowRedeclaration && symbol.isBound) symbol.owner else symbolTable.declareProperty(uniqId, { symbol }) {
|
||||
irFactory.createProperty(
|
||||
startOffset, endOffset, origin,
|
||||
it,
|
||||
@@ -681,8 +699,10 @@ class IrDeclarationDeserializer(
|
||||
flags.isExpect,
|
||||
flags.isFakeOverride
|
||||
)
|
||||
}.apply {
|
||||
if (!skipMutableState) {
|
||||
}
|
||||
|
||||
if (!skipMutableState) {
|
||||
prop.apply {
|
||||
withExternalValue(isExternal) {
|
||||
if (proto.hasGetter()) {
|
||||
getter = deserializeIrFunction(proto.getter).also {
|
||||
@@ -702,6 +722,8 @@ class IrDeclarationDeserializer(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prop
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
+4
-2
@@ -35,7 +35,7 @@ class IrFileDeserializer(
|
||||
|
||||
private var annotations: List<ProtoConstructorCall>? = fileProto.annotationList
|
||||
|
||||
internal fun deserializeDeclaration(idSig: IdSignature): IrDeclaration {
|
||||
fun deserializeDeclaration(idSig: IdSignature): IrDeclaration {
|
||||
return declarationDeserializer.deserializeDeclaration(loadTopLevelDeclarationProto(idSig)).also {
|
||||
file.declarations += it
|
||||
}
|
||||
@@ -66,6 +66,7 @@ class FileDeserializationState(
|
||||
allowErrorNodes: Boolean,
|
||||
deserializeInlineFunctions: Boolean,
|
||||
moduleDeserializer: IrModuleDeserializer,
|
||||
useGlobalSignatures: Boolean,
|
||||
handleNoModuleDeserializerFound: (IdSignature, ModuleDescriptor, Collection<IrModuleDeserializer>) -> IrModuleDeserializer,
|
||||
) {
|
||||
|
||||
@@ -75,6 +76,7 @@ class FileDeserializationState(
|
||||
fileProto.actualList,
|
||||
::addIdSignature,
|
||||
linker::handleExpectActualMapping,
|
||||
useGlobalSignatures = useGlobalSignatures,
|
||||
) { idSig, symbolKind ->
|
||||
|
||||
val topLevelSig = idSig.topLevelSignature()
|
||||
@@ -164,7 +166,7 @@ internal fun IrLibraryFile.deserializeDebugInfo(index: Int): String? = debugInfo
|
||||
internal fun IrLibraryFile.deserializeFqName(fqn: List<Int>): String =
|
||||
fqn.joinToString(".", transform = ::deserializeString)
|
||||
|
||||
internal fun IrLibraryFile.createFile(module: IrModuleFragment, fileProto: ProtoFile): IrFile {
|
||||
fun IrLibraryFile.createFile(module: IrModuleFragment, fileProto: ProtoFile): IrFile {
|
||||
val fileName = fileProto.fileEntry.name
|
||||
val fileEntry = NaiveSourceBasedFileEntryImpl(fileName, fileProto.fileEntry.lineStartOffsetList.toIntArray())
|
||||
val fqName = FqName(deserializeFqName(fileProto.fqNameList))
|
||||
|
||||
+15
-3
@@ -89,6 +89,8 @@ abstract class IrModuleDeserializer(val moduleDescriptor: ModuleDescriptor, val
|
||||
|
||||
open val isCurrent = false
|
||||
|
||||
open fun fileDeserializers(): Collection<IrFileDeserializer> = error("Unsupported")
|
||||
|
||||
val compatibilityMode: CompatibilityMode get() = CompatibilityMode(libraryAbiVersion)
|
||||
}
|
||||
|
||||
@@ -106,9 +108,11 @@ class IrModuleDeserializerWithBuiltIns(
|
||||
private val irBuiltInsMap = builtIns.knownBuiltins.map {
|
||||
val symbol = (it as IrSymbolOwner).symbol
|
||||
symbol.signature to symbol
|
||||
}.toMap()
|
||||
}.toMap() + additionalBuiltIns(builtIns)
|
||||
|
||||
private fun checkIsFunctionInterface(idSig: IdSignature): Boolean {
|
||||
protected open fun additionalBuiltIns(builtIns: IrBuiltIns): Map<IdSignature, IrSymbol> = emptyMap()
|
||||
|
||||
protected open fun checkIsFunctionInterface(idSig: IdSignature): Boolean {
|
||||
val publicSig = idSig.asPublic()
|
||||
return publicSig != null &&
|
||||
publicSig.packageFqName in functionalPackages &&
|
||||
@@ -146,7 +150,7 @@ class IrModuleDeserializerWithBuiltIns(
|
||||
}
|
||||
}
|
||||
|
||||
private fun resolveFunctionalInterface(idSig: IdSignature, symbolKind: BinarySymbolData.SymbolKind): IrSymbol {
|
||||
protected open fun resolveFunctionalInterface(idSig: IdSignature, symbolKind: BinarySymbolData.SymbolKind): IrSymbol {
|
||||
val publicSig = idSig.asPublic() ?: error("$idSig has to be public")
|
||||
|
||||
val fqnParts = publicSig.nameSegments
|
||||
@@ -209,6 +213,14 @@ class IrModuleDeserializerWithBuiltIns(
|
||||
override val moduleFragment: IrModuleFragment get() = delegate.moduleFragment
|
||||
override val moduleDependencies: Collection<IrModuleDeserializer> get() = delegate.moduleDependencies
|
||||
override val isCurrent get() = delegate.isCurrent
|
||||
|
||||
override fun fileDeserializers(): Collection<IrFileDeserializer> {
|
||||
return delegate.fileDeserializers()
|
||||
}
|
||||
|
||||
override fun postProcess() {
|
||||
delegate.postProcess()
|
||||
}
|
||||
}
|
||||
|
||||
open class CurrentModuleDeserializer(
|
||||
|
||||
+31
-13
@@ -12,12 +12,13 @@ import org.jetbrains.kotlin.ir.symbols.IrFileSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ParameterDescriptor
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAnonymousInitializer
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.ir.declarations.path
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrAnonymousInitializerSymbolImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrLocalDelegatedPropertySymbolImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.*
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.protobuf.CodedInputStream
|
||||
import org.jetbrains.kotlin.protobuf.ExtensionRegistryLite
|
||||
@@ -56,7 +57,7 @@ class IrSymbolDeserializer(
|
||||
|
||||
private fun referenceDeserializedSymbol(symbolKind: BinarySymbolData.SymbolKind, idSig: IdSignature): IrSymbol = symbolTable.run {
|
||||
when (symbolKind) {
|
||||
BinarySymbolData.SymbolKind.ANONYMOUS_INIT_SYMBOL -> IrAnonymousInitializerSymbolImpl()
|
||||
BinarySymbolData.SymbolKind.ANONYMOUS_INIT_SYMBOL -> if (useGlobalSignatures) IrAnonymousInitializerPublicSymbolImpl(idSig) else IrAnonymousInitializerSymbolImpl()
|
||||
BinarySymbolData.SymbolKind.CLASS_SYMBOL -> referenceClassFromLinker(idSig)
|
||||
BinarySymbolData.SymbolKind.CONSTRUCTOR_SYMBOL -> referenceConstructorFromLinker(idSig)
|
||||
BinarySymbolData.SymbolKind.TYPE_PARAMETER_SYMBOL -> referenceTypeParameterFromLinker(idSig)
|
||||
@@ -67,8 +68,8 @@ class IrSymbolDeserializer(
|
||||
BinarySymbolData.SymbolKind.TYPEALIAS_SYMBOL -> referenceTypeAliasFromLinker(idSig)
|
||||
BinarySymbolData.SymbolKind.PROPERTY_SYMBOL -> referencePropertyFromLinker(idSig)
|
||||
BinarySymbolData.SymbolKind.VARIABLE_SYMBOL -> IrVariableSymbolImpl()
|
||||
BinarySymbolData.SymbolKind.VALUE_PARAMETER_SYMBOL -> IrValueParameterSymbolImpl()
|
||||
BinarySymbolData.SymbolKind.RECEIVER_PARAMETER_SYMBOL -> IrValueParameterSymbolImpl()
|
||||
BinarySymbolData.SymbolKind.VALUE_PARAMETER_SYMBOL -> if (useGlobalSignatures) IrValueParameterPublicSymbolImpl(idSig) else IrValueParameterSymbolImpl()
|
||||
BinarySymbolData.SymbolKind.RECEIVER_PARAMETER_SYMBOL -> if (useGlobalSignatures) IrValueParameterPublicSymbolImpl(idSig) else IrValueParameterSymbolImpl()
|
||||
BinarySymbolData.SymbolKind.LOCAL_DELEGATED_PROPERTY_SYMBOL ->
|
||||
IrLocalDelegatedPropertySymbolImpl()
|
||||
BinarySymbolData.SymbolKind.FILE_SYMBOL -> (idSig as IdSignature.FileSignature).fileSymbol
|
||||
@@ -111,10 +112,14 @@ class IrSymbolDeserializer(
|
||||
|
||||
fun parseSymbolData(code: Long): BinarySymbolData = BinarySymbolData.decode(code)
|
||||
|
||||
private val symbolCache = HashMap<Long, IrSymbol>()
|
||||
|
||||
fun deserializeIrSymbol(code: Long): IrSymbol {
|
||||
val symbolData = parseSymbolData(code)
|
||||
val signature = deserializeIdSignature(symbolData.signatureId)
|
||||
return deserializeIrSymbolData(signature, symbolData.kind)
|
||||
return symbolCache.getOrPut(code) {
|
||||
val symbolData = parseSymbolData(code)
|
||||
val signature = deserializeIdSignature(symbolData.signatureId)
|
||||
deserializeIrSymbolData(signature, symbolData.kind)
|
||||
}
|
||||
}
|
||||
|
||||
private fun readSignature(index: Int): CodedInputStream =
|
||||
@@ -124,9 +129,13 @@ class IrSymbolDeserializer(
|
||||
return ProtoIdSignature.parseFrom(readSignature(index), ExtensionRegistryLite.newInstance())
|
||||
}
|
||||
|
||||
private val signatureCache = HashMap<Int, IdSignature>()
|
||||
|
||||
fun deserializeIdSignature(index: Int): IdSignature {
|
||||
val sigData = loadSignatureProto(index)
|
||||
return deserializeSignatureData(sigData)
|
||||
return signatureCache.getOrPut(index) {
|
||||
val sigData = loadSignatureProto(index)
|
||||
deserializeSignatureData(sigData)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
@@ -214,4 +223,13 @@ class IrSymbolDeserializer(
|
||||
else -> error("Unexpected IdSignature kind: ${proto.idsigCase}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: make internal and move to deserializer
|
||||
private class IrAnonymousInitializerPublicSymbolImpl(sig: IdSignature, descriptor: ClassDescriptor? = null) :
|
||||
IrBindablePublicSymbolBase<ClassDescriptor, IrAnonymousInitializer>(sig, descriptor),
|
||||
IrAnonymousInitializerSymbol
|
||||
|
||||
private class IrValueParameterPublicSymbolImpl(sig: IdSignature, descriptor: ParameterDescriptor? = null) :
|
||||
IrBindablePublicSymbolBase<ParameterDescriptor, IrValueParameter>(sig, descriptor),
|
||||
IrValueParameterSymbol
|
||||
|
||||
+5
-8
@@ -37,12 +37,12 @@ abstract class KotlinIrLinker(
|
||||
) : IrDeserializer, FileLocalAwareLinker {
|
||||
|
||||
// Kotlin-MPP related data. Consider some refactoring
|
||||
internal val expectUniqIdToActualUniqId = mutableMapOf<IdSignature, IdSignature>()
|
||||
internal val topLevelActualUniqItToDeserializer = mutableMapOf<IdSignature, IrModuleDeserializer>()
|
||||
val expectUniqIdToActualUniqId = mutableMapOf<IdSignature, IdSignature>()
|
||||
val topLevelActualUniqItToDeserializer = mutableMapOf<IdSignature, IrModuleDeserializer>()
|
||||
internal val expectSymbols = mutableMapOf<IdSignature, IrSymbol>()
|
||||
internal val actualSymbols = mutableMapOf<IdSignature, IrSymbol>()
|
||||
|
||||
internal val modulesWithReachableTopLevels = mutableSetOf<IrModuleDeserializer>()
|
||||
val modulesWithReachableTopLevels = mutableSetOf<IrModuleDeserializer>()
|
||||
|
||||
protected val deserializersForModules = mutableMapOf<String, IrModuleDeserializer>()
|
||||
|
||||
@@ -51,7 +51,7 @@ abstract class KotlinIrLinker(
|
||||
abstract val translationPluginContext: TranslationPluginContext?
|
||||
|
||||
internal val triedToDeserializeDeclarationForSymbol = mutableSetOf<IrSymbol>()
|
||||
internal val deserializedSymbols = mutableSetOf<IrSymbol>()
|
||||
val deserializedSymbols = mutableSetOf<IrSymbol>()
|
||||
|
||||
private lateinit var linkerExtensions: Collection<IrDeserializer.IrLinkerExtension>
|
||||
|
||||
@@ -101,7 +101,6 @@ abstract class KotlinIrLinker(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
private fun findDeserializedDeclarationForSymbol(symbol: IrSymbol): DeclarationDescriptor? {
|
||||
|
||||
if (symbol in triedToDeserializeDeclarationForSymbol || symbol in deserializedSymbols) {
|
||||
@@ -123,7 +122,6 @@ abstract class KotlinIrLinker(
|
||||
|
||||
protected open fun platformSpecificSymbol(symbol: IrSymbol): Boolean = false
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
private fun tryResolveCustomDeclaration(symbol: IrSymbol): IrDeclaration? {
|
||||
if (!symbol.hasDescriptor) return null
|
||||
|
||||
@@ -145,7 +143,6 @@ abstract class KotlinIrLinker(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
override fun getDeclaration(symbol: IrSymbol): IrDeclaration? {
|
||||
|
||||
if (!symbol.isPublicApi) {
|
||||
@@ -308,7 +305,7 @@ abstract class KotlinIrLinker(
|
||||
return deserializerForModule.moduleFragment
|
||||
}
|
||||
|
||||
private fun maybeWrapWithBuiltInAndInit(
|
||||
protected open fun maybeWrapWithBuiltInAndInit(
|
||||
moduleDescriptor: ModuleDescriptor,
|
||||
moduleDeserializer: IrModuleDeserializer
|
||||
): IrModuleDeserializer =
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@ value class BinaryCoordinates(private val decoded: BinaryLattice) {
|
||||
|
||||
companion object {
|
||||
fun encode(startOffset: Int, endOffset: Int): Long {
|
||||
assert(startOffset <= endOffset)
|
||||
return BinaryLattice.encode(startOffset, endOffset - startOffset)
|
||||
// assert(startOffset <= endOffset)
|
||||
return BinaryLattice.encode(startOffset, Math.abs(endOffset - startOffset))
|
||||
}
|
||||
|
||||
fun decode(code: Long) = BinaryCoordinates(BinaryLattice.decode(code)).also { assert(it.startOffset <= it.endOffset) }
|
||||
|
||||
+18
-22
@@ -177,13 +177,13 @@ public final class IrLocalDelegatedProperty extends
|
||||
public static final int DELEGATE_FIELD_NUMBER = 3;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
*/
|
||||
public boolean hasDelegate() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable getDelegate() {
|
||||
return delegate_;
|
||||
@@ -240,17 +240,15 @@ public final class IrLocalDelegatedProperty extends
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasDelegate()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!getBase().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!getDelegate().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
if (hasDelegate()) {
|
||||
if (!getDelegate().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasGetter()) {
|
||||
if (!getGetter().isInitialized()) {
|
||||
@@ -497,17 +495,15 @@ public final class IrLocalDelegatedProperty extends
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasDelegate()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getBase().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getDelegate().isInitialized()) {
|
||||
|
||||
return false;
|
||||
if (hasDelegate()) {
|
||||
if (!getDelegate().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasGetter()) {
|
||||
if (!getGetter().isInitialized()) {
|
||||
@@ -637,19 +633,19 @@ public final class IrLocalDelegatedProperty extends
|
||||
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable.getDefaultInstance();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
*/
|
||||
public boolean hasDelegate() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable getDelegate() {
|
||||
return delegate_;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
*/
|
||||
public Builder setDelegate(org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable value) {
|
||||
if (value == null) {
|
||||
@@ -661,7 +657,7 @@ public final class IrLocalDelegatedProperty extends
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
*/
|
||||
public Builder setDelegate(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable.Builder builderForValue) {
|
||||
@@ -671,7 +667,7 @@ public final class IrLocalDelegatedProperty extends
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
*/
|
||||
public Builder mergeDelegate(org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable value) {
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004) &&
|
||||
@@ -686,7 +682,7 @@ public final class IrLocalDelegatedProperty extends
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
*/
|
||||
public Builder clearDelegate() {
|
||||
delegate_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable.getDefaultInstance();
|
||||
|
||||
+2
-2
@@ -26,11 +26,11 @@ public interface IrLocalDelegatedPropertyOrBuilder extends
|
||||
long getNameType();
|
||||
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
*/
|
||||
boolean hasDelegate();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable delegate = 3;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable getDelegate();
|
||||
|
||||
|
||||
+84
-84
@@ -514,9 +514,9 @@ public final class IrOperation extends
|
||||
operationCase_ = 35;
|
||||
break;
|
||||
}
|
||||
case 290: {
|
||||
case 1090: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference.Builder subBuilder = null;
|
||||
if (operationCase_ == 36) {
|
||||
if (operationCase_ == 136) {
|
||||
subBuilder = ((org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference) operation_).toBuilder();
|
||||
}
|
||||
operation_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference.PARSER, extensionRegistry);
|
||||
@@ -524,12 +524,12 @@ public final class IrOperation extends
|
||||
subBuilder.mergeFrom((org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference) operation_);
|
||||
operation_ = subBuilder.buildPartial();
|
||||
}
|
||||
operationCase_ = 36;
|
||||
operationCase_ = 136;
|
||||
break;
|
||||
}
|
||||
case 298: {
|
||||
case 1098: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock.Builder subBuilder = null;
|
||||
if (operationCase_ == 37) {
|
||||
if (operationCase_ == 137) {
|
||||
subBuilder = ((org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock) operation_).toBuilder();
|
||||
}
|
||||
operation_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock.PARSER, extensionRegistry);
|
||||
@@ -537,12 +537,12 @@ public final class IrOperation extends
|
||||
subBuilder.mergeFrom((org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock) operation_);
|
||||
operation_ = subBuilder.buildPartial();
|
||||
}
|
||||
operationCase_ = 37;
|
||||
operationCase_ = 137;
|
||||
break;
|
||||
}
|
||||
case 306: {
|
||||
case 1106: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn.Builder subBuilder = null;
|
||||
if (operationCase_ == 38) {
|
||||
if (operationCase_ == 138) {
|
||||
subBuilder = ((org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn) operation_).toBuilder();
|
||||
}
|
||||
operation_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn.PARSER, extensionRegistry);
|
||||
@@ -550,7 +550,7 @@ public final class IrOperation extends
|
||||
subBuilder.mergeFrom((org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn) operation_);
|
||||
operation_ = subBuilder.buildPartial();
|
||||
}
|
||||
operationCase_ = 38;
|
||||
operationCase_ = 138;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -627,9 +627,9 @@ public final class IrOperation extends
|
||||
FUNCTION_EXPRESSION(33),
|
||||
ERROR_EXPRESSION(34),
|
||||
ERROR_CALL_EXPRESSION(35),
|
||||
RAW_FUNCTION_REFERENCE(36),
|
||||
RETURNABLE_BLOCK(37),
|
||||
RETURNABLE_BLOCK_RETURN(38),
|
||||
RAW_FUNCTION_REFERENCE(136),
|
||||
RETURNABLE_BLOCK(137),
|
||||
RETURNABLE_BLOCK_RETURN(138),
|
||||
OPERATION_NOT_SET(0);
|
||||
private int value = 0;
|
||||
private OperationCase(int value) {
|
||||
@@ -672,9 +672,9 @@ public final class IrOperation extends
|
||||
case 33: return FUNCTION_EXPRESSION;
|
||||
case 34: return ERROR_EXPRESSION;
|
||||
case 35: return ERROR_CALL_EXPRESSION;
|
||||
case 36: return RAW_FUNCTION_REFERENCE;
|
||||
case 37: return RETURNABLE_BLOCK;
|
||||
case 38: return RETURNABLE_BLOCK_RETURN;
|
||||
case 136: return RAW_FUNCTION_REFERENCE;
|
||||
case 137: return RETURNABLE_BLOCK;
|
||||
case 138: return RETURNABLE_BLOCK_RETURN;
|
||||
case 0: return OPERATION_NOT_SET;
|
||||
default: throw new java.lang.IllegalArgumentException(
|
||||
"Value is undefined for this oneof enum.");
|
||||
@@ -1294,52 +1294,52 @@ public final class IrOperation extends
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorCallExpression.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int RAW_FUNCTION_REFERENCE_FIELD_NUMBER = 36;
|
||||
public static final int RAW_FUNCTION_REFERENCE_FIELD_NUMBER = 136;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 136;</code>
|
||||
*/
|
||||
public boolean hasRawFunctionReference() {
|
||||
return operationCase_ == 36;
|
||||
return operationCase_ == 136;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 136;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference getRawFunctionReference() {
|
||||
if (operationCase_ == 36) {
|
||||
if (operationCase_ == 136) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference) operation_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int RETURNABLE_BLOCK_FIELD_NUMBER = 37;
|
||||
public static final int RETURNABLE_BLOCK_FIELD_NUMBER = 137;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 137;</code>
|
||||
*/
|
||||
public boolean hasReturnableBlock() {
|
||||
return operationCase_ == 37;
|
||||
return operationCase_ == 137;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 137;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock getReturnableBlock() {
|
||||
if (operationCase_ == 37) {
|
||||
if (operationCase_ == 137) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock) operation_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int RETURNABLE_BLOCK_RETURN_FIELD_NUMBER = 38;
|
||||
public static final int RETURNABLE_BLOCK_RETURN_FIELD_NUMBER = 138;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 138;</code>
|
||||
*/
|
||||
public boolean hasReturnableBlockReturn() {
|
||||
return operationCase_ == 38;
|
||||
return operationCase_ == 138;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 138;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn getReturnableBlockReturn() {
|
||||
if (operationCase_ == 38) {
|
||||
if (operationCase_ == 138) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn) operation_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn.getDefaultInstance();
|
||||
@@ -1687,14 +1687,14 @@ public final class IrOperation extends
|
||||
if (operationCase_ == 35) {
|
||||
output.writeMessage(35, (org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorCallExpression) operation_);
|
||||
}
|
||||
if (operationCase_ == 36) {
|
||||
output.writeMessage(36, (org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference) operation_);
|
||||
if (operationCase_ == 136) {
|
||||
output.writeMessage(136, (org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference) operation_);
|
||||
}
|
||||
if (operationCase_ == 37) {
|
||||
output.writeMessage(37, (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock) operation_);
|
||||
if (operationCase_ == 137) {
|
||||
output.writeMessage(137, (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock) operation_);
|
||||
}
|
||||
if (operationCase_ == 38) {
|
||||
output.writeMessage(38, (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn) operation_);
|
||||
if (operationCase_ == 138) {
|
||||
output.writeMessage(138, (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn) operation_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
@@ -1845,17 +1845,17 @@ public final class IrOperation extends
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(35, (org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorCallExpression) operation_);
|
||||
}
|
||||
if (operationCase_ == 36) {
|
||||
if (operationCase_ == 136) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(36, (org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference) operation_);
|
||||
.computeMessageSize(136, (org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference) operation_);
|
||||
}
|
||||
if (operationCase_ == 37) {
|
||||
if (operationCase_ == 137) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(37, (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock) operation_);
|
||||
.computeMessageSize(137, (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock) operation_);
|
||||
}
|
||||
if (operationCase_ == 38) {
|
||||
if (operationCase_ == 138) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(38, (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn) operation_);
|
||||
.computeMessageSize(138, (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn) operation_);
|
||||
}
|
||||
size += unknownFields.size();
|
||||
memoizedSerializedSize = size;
|
||||
@@ -2088,13 +2088,13 @@ public final class IrOperation extends
|
||||
if (operationCase_ == 35) {
|
||||
result.operation_ = operation_;
|
||||
}
|
||||
if (operationCase_ == 36) {
|
||||
if (operationCase_ == 136) {
|
||||
result.operation_ = operation_;
|
||||
}
|
||||
if (operationCase_ == 37) {
|
||||
if (operationCase_ == 137) {
|
||||
result.operation_ = operation_;
|
||||
}
|
||||
if (operationCase_ == 38) {
|
||||
if (operationCase_ == 138) {
|
||||
result.operation_ = operation_;
|
||||
}
|
||||
result.bitField0_ = to_bitField0_;
|
||||
@@ -4792,22 +4792,22 @@ public final class IrOperation extends
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 136;</code>
|
||||
*/
|
||||
public boolean hasRawFunctionReference() {
|
||||
return operationCase_ == 36;
|
||||
return operationCase_ == 136;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 136;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference getRawFunctionReference() {
|
||||
if (operationCase_ == 36) {
|
||||
if (operationCase_ == 136) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference) operation_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference.getDefaultInstance();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 136;</code>
|
||||
*/
|
||||
public Builder setRawFunctionReference(org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference value) {
|
||||
if (value == null) {
|
||||
@@ -4815,24 +4815,24 @@ public final class IrOperation extends
|
||||
}
|
||||
operation_ = value;
|
||||
|
||||
operationCase_ = 36;
|
||||
operationCase_ = 136;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 136;</code>
|
||||
*/
|
||||
public Builder setRawFunctionReference(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference.Builder builderForValue) {
|
||||
operation_ = builderForValue.build();
|
||||
|
||||
operationCase_ = 36;
|
||||
operationCase_ = 136;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 136;</code>
|
||||
*/
|
||||
public Builder mergeRawFunctionReference(org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference value) {
|
||||
if (operationCase_ == 36 &&
|
||||
if (operationCase_ == 136 &&
|
||||
operation_ != org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference.getDefaultInstance()) {
|
||||
operation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference.newBuilder((org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference) operation_)
|
||||
.mergeFrom(value).buildPartial();
|
||||
@@ -4840,14 +4840,14 @@ public final class IrOperation extends
|
||||
operation_ = value;
|
||||
}
|
||||
|
||||
operationCase_ = 36;
|
||||
operationCase_ = 136;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 136;</code>
|
||||
*/
|
||||
public Builder clearRawFunctionReference() {
|
||||
if (operationCase_ == 36) {
|
||||
if (operationCase_ == 136) {
|
||||
operationCase_ = 0;
|
||||
operation_ = null;
|
||||
|
||||
@@ -4856,22 +4856,22 @@ public final class IrOperation extends
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 137;</code>
|
||||
*/
|
||||
public boolean hasReturnableBlock() {
|
||||
return operationCase_ == 37;
|
||||
return operationCase_ == 137;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 137;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock getReturnableBlock() {
|
||||
if (operationCase_ == 37) {
|
||||
if (operationCase_ == 137) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock) operation_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock.getDefaultInstance();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 137;</code>
|
||||
*/
|
||||
public Builder setReturnableBlock(org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock value) {
|
||||
if (value == null) {
|
||||
@@ -4879,24 +4879,24 @@ public final class IrOperation extends
|
||||
}
|
||||
operation_ = value;
|
||||
|
||||
operationCase_ = 37;
|
||||
operationCase_ = 137;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 137;</code>
|
||||
*/
|
||||
public Builder setReturnableBlock(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock.Builder builderForValue) {
|
||||
operation_ = builderForValue.build();
|
||||
|
||||
operationCase_ = 37;
|
||||
operationCase_ = 137;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 137;</code>
|
||||
*/
|
||||
public Builder mergeReturnableBlock(org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock value) {
|
||||
if (operationCase_ == 37 &&
|
||||
if (operationCase_ == 137 &&
|
||||
operation_ != org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock.getDefaultInstance()) {
|
||||
operation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock.newBuilder((org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock) operation_)
|
||||
.mergeFrom(value).buildPartial();
|
||||
@@ -4904,14 +4904,14 @@ public final class IrOperation extends
|
||||
operation_ = value;
|
||||
}
|
||||
|
||||
operationCase_ = 37;
|
||||
operationCase_ = 137;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 137;</code>
|
||||
*/
|
||||
public Builder clearReturnableBlock() {
|
||||
if (operationCase_ == 37) {
|
||||
if (operationCase_ == 137) {
|
||||
operationCase_ = 0;
|
||||
operation_ = null;
|
||||
|
||||
@@ -4920,22 +4920,22 @@ public final class IrOperation extends
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 138;</code>
|
||||
*/
|
||||
public boolean hasReturnableBlockReturn() {
|
||||
return operationCase_ == 38;
|
||||
return operationCase_ == 138;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 138;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn getReturnableBlockReturn() {
|
||||
if (operationCase_ == 38) {
|
||||
if (operationCase_ == 138) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn) operation_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn.getDefaultInstance();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 138;</code>
|
||||
*/
|
||||
public Builder setReturnableBlockReturn(org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn value) {
|
||||
if (value == null) {
|
||||
@@ -4943,24 +4943,24 @@ public final class IrOperation extends
|
||||
}
|
||||
operation_ = value;
|
||||
|
||||
operationCase_ = 38;
|
||||
operationCase_ = 138;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 138;</code>
|
||||
*/
|
||||
public Builder setReturnableBlockReturn(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn.Builder builderForValue) {
|
||||
operation_ = builderForValue.build();
|
||||
|
||||
operationCase_ = 38;
|
||||
operationCase_ = 138;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 138;</code>
|
||||
*/
|
||||
public Builder mergeReturnableBlockReturn(org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn value) {
|
||||
if (operationCase_ == 38 &&
|
||||
if (operationCase_ == 138 &&
|
||||
operation_ != org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn.getDefaultInstance()) {
|
||||
operation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn.newBuilder((org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn) operation_)
|
||||
.mergeFrom(value).buildPartial();
|
||||
@@ -4968,14 +4968,14 @@ public final class IrOperation extends
|
||||
operation_ = value;
|
||||
}
|
||||
|
||||
operationCase_ = 38;
|
||||
operationCase_ = 138;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 138;</code>
|
||||
*/
|
||||
public Builder clearReturnableBlockReturn() {
|
||||
if (operationCase_ == 38) {
|
||||
if (operationCase_ == 138) {
|
||||
operationCase_ = 0;
|
||||
operation_ = null;
|
||||
|
||||
|
||||
+6
-6
@@ -331,29 +331,29 @@ public interface IrOperationOrBuilder extends
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorCallExpression getErrorCallExpression();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 136;</code>
|
||||
*/
|
||||
boolean hasRawFunctionReference();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 136;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference getRawFunctionReference();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 137;</code>
|
||||
*/
|
||||
boolean hasReturnableBlock();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 137;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock getReturnableBlock();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 138;</code>
|
||||
*/
|
||||
boolean hasReturnableBlockReturn();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 138;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn getReturnableBlockReturn();
|
||||
}
|
||||
+20
-20
@@ -92,12 +92,12 @@ public final class IrTypeParameter extends
|
||||
input.popLimit(limit);
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
case 832: {
|
||||
bitField0_ |= 0x00000004;
|
||||
index_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 40: {
|
||||
case 840: {
|
||||
bitField0_ |= 0x00000008;
|
||||
isGlobal_ = input.readBool();
|
||||
break;
|
||||
@@ -192,31 +192,31 @@ public final class IrTypeParameter extends
|
||||
}
|
||||
private int superTypeMemoizedSerializedSize = -1;
|
||||
|
||||
public static final int INDEX_FIELD_NUMBER = 4;
|
||||
public static final int INDEX_FIELD_NUMBER = 104;
|
||||
private int index_;
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
* <code>optional int32 index = 104;</code>
|
||||
*/
|
||||
public boolean hasIndex() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
* <code>optional int32 index = 104;</code>
|
||||
*/
|
||||
public int getIndex() {
|
||||
return index_;
|
||||
}
|
||||
|
||||
public static final int ISGLOBAL_FIELD_NUMBER = 5;
|
||||
public static final int ISGLOBAL_FIELD_NUMBER = 105;
|
||||
private boolean isGlobal_;
|
||||
/**
|
||||
* <code>optional bool isGlobal = 5;</code>
|
||||
* <code>optional bool isGlobal = 105;</code>
|
||||
*/
|
||||
public boolean hasIsGlobal() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>optional bool isGlobal = 5;</code>
|
||||
* <code>optional bool isGlobal = 105;</code>
|
||||
*/
|
||||
public boolean getIsGlobal() {
|
||||
return isGlobal_;
|
||||
@@ -268,10 +268,10 @@ public final class IrTypeParameter extends
|
||||
output.writeInt32NoTag(superType_.get(i));
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
output.writeInt32(4, index_);
|
||||
output.writeInt32(104, index_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
output.writeBool(5, isGlobal_);
|
||||
output.writeBool(105, isGlobal_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
@@ -306,11 +306,11 @@ public final class IrTypeParameter extends
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32Size(4, index_);
|
||||
.computeInt32Size(104, index_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeBoolSize(5, isGlobal_);
|
||||
.computeBoolSize(105, isGlobal_);
|
||||
}
|
||||
size += unknownFields.size();
|
||||
memoizedSerializedSize = size;
|
||||
@@ -688,19 +688,19 @@ public final class IrTypeParameter extends
|
||||
|
||||
private int index_ ;
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
* <code>optional int32 index = 104;</code>
|
||||
*/
|
||||
public boolean hasIndex() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
* <code>optional int32 index = 104;</code>
|
||||
*/
|
||||
public int getIndex() {
|
||||
return index_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
* <code>optional int32 index = 104;</code>
|
||||
*/
|
||||
public Builder setIndex(int value) {
|
||||
bitField0_ |= 0x00000008;
|
||||
@@ -709,7 +709,7 @@ public final class IrTypeParameter extends
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
* <code>optional int32 index = 104;</code>
|
||||
*/
|
||||
public Builder clearIndex() {
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
@@ -720,19 +720,19 @@ public final class IrTypeParameter extends
|
||||
|
||||
private boolean isGlobal_ ;
|
||||
/**
|
||||
* <code>optional bool isGlobal = 5;</code>
|
||||
* <code>optional bool isGlobal = 105;</code>
|
||||
*/
|
||||
public boolean hasIsGlobal() {
|
||||
return ((bitField0_ & 0x00000010) == 0x00000010);
|
||||
}
|
||||
/**
|
||||
* <code>optional bool isGlobal = 5;</code>
|
||||
* <code>optional bool isGlobal = 105;</code>
|
||||
*/
|
||||
public boolean getIsGlobal() {
|
||||
return isGlobal_;
|
||||
}
|
||||
/**
|
||||
* <code>optional bool isGlobal = 5;</code>
|
||||
* <code>optional bool isGlobal = 105;</code>
|
||||
*/
|
||||
public Builder setIsGlobal(boolean value) {
|
||||
bitField0_ |= 0x00000010;
|
||||
@@ -741,7 +741,7 @@ public final class IrTypeParameter extends
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional bool isGlobal = 5;</code>
|
||||
* <code>optional bool isGlobal = 105;</code>
|
||||
*/
|
||||
public Builder clearIsGlobal() {
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
|
||||
+4
-4
@@ -39,20 +39,20 @@ public interface IrTypeParameterOrBuilder extends
|
||||
int getSuperType(int index);
|
||||
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
* <code>optional int32 index = 104;</code>
|
||||
*/
|
||||
boolean hasIndex();
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
* <code>optional int32 index = 104;</code>
|
||||
*/
|
||||
int getIndex();
|
||||
|
||||
/**
|
||||
* <code>optional bool isGlobal = 5;</code>
|
||||
* <code>optional bool isGlobal = 105;</code>
|
||||
*/
|
||||
boolean hasIsGlobal();
|
||||
/**
|
||||
* <code>optional bool isGlobal = 5;</code>
|
||||
* <code>optional bool isGlobal = 105;</code>
|
||||
*/
|
||||
boolean getIsGlobal();
|
||||
}
|
||||
+10
-10
@@ -81,7 +81,7 @@ public final class IrValueParameter extends
|
||||
defaultValue_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 40: {
|
||||
case 840: {
|
||||
bitField0_ |= 0x00000010;
|
||||
index_ = input.readInt32();
|
||||
break;
|
||||
@@ -180,16 +180,16 @@ public final class IrValueParameter extends
|
||||
return defaultValue_;
|
||||
}
|
||||
|
||||
public static final int INDEX_FIELD_NUMBER = 5;
|
||||
public static final int INDEX_FIELD_NUMBER = 105;
|
||||
private int index_;
|
||||
/**
|
||||
* <code>optional int32 index = 5;</code>
|
||||
* <code>optional int32 index = 105;</code>
|
||||
*/
|
||||
public boolean hasIndex() {
|
||||
return ((bitField0_ & 0x00000010) == 0x00000010);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 index = 5;</code>
|
||||
* <code>optional int32 index = 105;</code>
|
||||
*/
|
||||
public int getIndex() {
|
||||
return index_;
|
||||
@@ -240,7 +240,7 @@ public final class IrValueParameter extends
|
||||
output.writeInt32(4, defaultValue_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
output.writeInt32(5, index_);
|
||||
output.writeInt32(105, index_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
@@ -269,7 +269,7 @@ public final class IrValueParameter extends
|
||||
}
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32Size(5, index_);
|
||||
.computeInt32Size(105, index_);
|
||||
}
|
||||
size += unknownFields.size();
|
||||
memoizedSerializedSize = size;
|
||||
@@ -637,19 +637,19 @@ public final class IrValueParameter extends
|
||||
|
||||
private int index_ ;
|
||||
/**
|
||||
* <code>optional int32 index = 5;</code>
|
||||
* <code>optional int32 index = 105;</code>
|
||||
*/
|
||||
public boolean hasIndex() {
|
||||
return ((bitField0_ & 0x00000010) == 0x00000010);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 index = 5;</code>
|
||||
* <code>optional int32 index = 105;</code>
|
||||
*/
|
||||
public int getIndex() {
|
||||
return index_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 index = 5;</code>
|
||||
* <code>optional int32 index = 105;</code>
|
||||
*/
|
||||
public Builder setIndex(int value) {
|
||||
bitField0_ |= 0x00000010;
|
||||
@@ -658,7 +658,7 @@ public final class IrValueParameter extends
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 index = 5;</code>
|
||||
* <code>optional int32 index = 105;</code>
|
||||
*/
|
||||
public Builder clearIndex() {
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
|
||||
+2
-2
@@ -44,11 +44,11 @@ public interface IrValueParameterOrBuilder extends
|
||||
int getDefaultValue();
|
||||
|
||||
/**
|
||||
* <code>optional int32 index = 5;</code>
|
||||
* <code>optional int32 index = 105;</code>
|
||||
*/
|
||||
boolean hasIndex();
|
||||
/**
|
||||
* <code>optional int32 index = 5;</code>
|
||||
* <code>optional int32 index = 105;</code>
|
||||
*/
|
||||
int getIndex();
|
||||
}
|
||||
+22
-11
@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
import org.jetbrains.kotlin.ir.util.KotlinMangler
|
||||
import org.jetbrains.kotlin.ir.util.isFacadeClass
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
|
||||
import org.jetbrains.kotlin.ir.visitors.acceptVoid
|
||||
|
||||
@@ -203,8 +204,6 @@ class PublicIdSignatureComputer(val mangler: KotlinMangler.IrMangler) : IdSignat
|
||||
open class IdSignatureSerializer(
|
||||
private val publicSignatureBuilder: PublicIdSignatureComputer,
|
||||
private val table: DeclarationTable,
|
||||
localIndexOffset: Long = 0,
|
||||
scopeIndexOffset: Int = 0,
|
||||
) : IdSignatureComputer {
|
||||
|
||||
private val mangler: KotlinMangler.IrMangler = publicSignatureBuilder.mangler
|
||||
@@ -219,8 +218,8 @@ open class IdSignatureSerializer(
|
||||
} else composeFileLocalIdSignature(declaration, compatibleMode)
|
||||
}
|
||||
|
||||
private var localIndex: Long = localIndexOffset
|
||||
private var scopeIndex: Int = scopeIndexOffset
|
||||
protected var localIndex: Long = 0
|
||||
protected var scopeIndex: Int = 0
|
||||
|
||||
override fun inFile(file: IrFileSymbol?, block: () -> Unit) {
|
||||
publicSignatureBuilder.inFile(file, block)
|
||||
@@ -238,19 +237,19 @@ open class IdSignatureSerializer(
|
||||
|
||||
return table.privateDeclarationSignature(declaration, compatibleMode) {
|
||||
when (declaration) {
|
||||
is IrValueDeclaration -> IdSignature.ScopeLocalDeclaration(scopeIndex++, declaration.name.asString())
|
||||
is IrAnonymousInitializer -> IdSignature.ScopeLocalDeclaration(scopeIndex++, "ANON INIT")
|
||||
is IrLocalDelegatedProperty -> IdSignature.ScopeLocalDeclaration(scopeIndex++, declaration.name.asString())
|
||||
is IrValueDeclaration -> declaration.createScopeLocalSignature(scopeIndex++, declaration.name.asString())
|
||||
is IrAnonymousInitializer -> declaration.createScopeLocalSignature(scopeIndex++, "ANON INIT")
|
||||
is IrLocalDelegatedProperty -> declaration.createScopeLocalSignature(scopeIndex++, declaration.name.asString())
|
||||
is IrField -> {
|
||||
val p = declaration.correspondingPropertySymbol?.let { composeSignatureForDeclaration(it.owner, true) }
|
||||
?: composeContainerIdSignature(declaration.parent, compatibleMode)
|
||||
IdSignature.FileLocalSignature(p, ++localIndex)
|
||||
declaration.createFileLocalSignature(p, ++localIndex)
|
||||
}
|
||||
is IrSimpleFunction -> {
|
||||
val parent = declaration.parent
|
||||
val p = declaration.correspondingPropertySymbol?.let { composeSignatureForDeclaration(it.owner, true) }
|
||||
?: composeContainerIdSignature(parent, compatibleMode)
|
||||
IdSignature.FileLocalSignature(
|
||||
declaration.createFileLocalSignature(
|
||||
p,
|
||||
if (declaration.isOverridableFunction()) {
|
||||
mangler.run { declaration.signatureMangle() }
|
||||
@@ -262,7 +261,7 @@ open class IdSignatureSerializer(
|
||||
}
|
||||
is IrProperty -> {
|
||||
val parent = declaration.parent
|
||||
IdSignature.FileLocalSignature(
|
||||
declaration.createFileLocalSignature(
|
||||
composeContainerIdSignature(parent, compatibleMode),
|
||||
|
||||
if (declaration.isOverridableProperty()) {
|
||||
@@ -274,9 +273,21 @@ open class IdSignatureSerializer(
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
IdSignature.FileLocalSignature(composeContainerIdSignature(declaration.parent, compatibleMode), ++localIndex, declaration.render())
|
||||
declaration.createFileLocalSignature(
|
||||
composeContainerIdSignature(declaration.parent, compatibleMode),
|
||||
++localIndex,
|
||||
declaration.render()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected open fun IrDeclaration.createFileLocalSignature(parentSignature: IdSignature, localIndex: Long): IdSignature {
|
||||
return IdSignature.FileLocalSignature(parentSignature, localIndex)
|
||||
}
|
||||
|
||||
protected open fun IrDeclaration.createScopeLocalSignature(scopeIndex: Int, description: String): IdSignature {
|
||||
return IdSignature.ScopeLocalDeclaration(scopeIndex, description)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user