IR BE common: provide type arguments count explicitly for ir calls to reduce dependency on descriptors

(cherry picked from commit af76ae2)
This commit is contained in:
Zalim Bashorov
2018-06-22 20:45:27 +03:00
committed by Dmitry Petrov
parent f002e6030a
commit 686a3d631c
2 changed files with 9 additions and 16 deletions
@@ -1,17 +1,6 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2010-2018 JetBrains s.r.o. 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.lower
@@ -134,7 +123,8 @@ open class DefaultArgumentStubGenerator constructor(val context: CommonBackendCo
startOffset = irFunction.startOffset,
endOffset = irFunction.endOffset,
type = context.irBuiltIns.unitType,
symbol = irFunction.symbol, descriptor = irFunction.symbol.descriptor
symbol = irFunction.symbol, descriptor = irFunction.symbol.descriptor,
typeArgumentsCount = irFunction.typeParameters.size
).apply {
params.forEachIndexed { i, variable ->
putValueArgument(i, irGet(variable))
@@ -215,7 +205,8 @@ class DefaultParameterInjector constructor(val context: CommonBackendContext, pr
endOffset = expression.endOffset,
type = context.irBuiltIns.unitType,
symbol = symbolForCall,
descriptor = symbolForCall.descriptor
descriptor = symbolForCall.descriptor,
typeArgumentsCount = symbolForCall.owner.typeParameters.size
)
.apply {
params.forEach {
@@ -289,7 +289,8 @@ class LocalDeclarationsLowering(val context: BackendContext, val localNameProvid
expression.startOffset, expression.endOffset,
context.irBuiltIns.unitType,
newCallee.symbol,
newCallee.descriptor
newCallee.descriptor,
expression.typeArgumentsCount
).also {
it.fillArguments(expression)
it.copyTypeArgumentsFrom(expression)
@@ -440,6 +441,7 @@ class LocalDeclarationsLowering(val context: BackendContext, val localNameProvid
newCallee.returnType,
newCallee.symbol,
newCallee.descriptor,
oldCall.typeArgumentsCount,
oldCall.origin, oldCall.superQualifierSymbol
).also {
it.copyTypeArgumentsFrom(oldCall)