Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
4c3ffc34
K
kotlin
项目概览
硅谷海盗
/
kotlin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4c3ffc34
编写于
12月 01, 2020
作者:
D
Dmitry Petrov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
JVM_IR KT-41911 process big arity 'invoke' arguments recursively
上级
b0e2d563
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
64 addition
and
2 deletion
+64
-2
compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java
...ns/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java
+5
-0
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionNVarargBridgeLowering.kt
...kotlin/backend/jvm/lower/FunctionNVarargBridgeLowering.kt
+7
-2
compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt
.../codegen/box/functions/bigArity/nestedBigArityFunCalls.kt
+17
-0
compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java
...etbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java
+5
-0
compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java
...brains/kotlin/codegen/LightAnalysisModeTestGenerated.java
+5
-0
compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java
...ins/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java
+5
-0
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
...js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
+5
-0
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java
...lin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java
+5
-0
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java
...s/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java
+5
-0
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
...js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
+5
-0
未找到文件。
compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java
浏览文件 @
4c3ffc34
...
@@ -12572,6 +12572,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
...
@@ -12572,6 +12572,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
}
}
@TestMetadata("nestedBigArityFunCalls.kt")
public void testNestedBigArityFunCalls() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
}
@TestMetadata("subclass.kt")
@TestMetadata("subclass.kt")
public void testSubclass() throws Exception {
public void testSubclass() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionNVarargBridgeLowering.kt
浏览文件 @
4c3ffc34
...
@@ -57,16 +57,21 @@ private class FunctionNVarargBridgeLowering(val context: JvmBackendContext) :
...
@@ -57,16 +57,21 @@ private class FunctionNVarargBridgeLowering(val context: JvmBackendContext) :
at
(
expression
)
at
(
expression
)
irCall
(
functionNInvokeFun
).
apply
{
irCall
(
functionNInvokeFun
).
apply
{
dispatchReceiver
=
irImplicitCast
(
dispatchReceiver
=
irImplicitCast
(
expression
.
dispatchReceiver
!!
,
expression
.
dispatchReceiver
!!
.
transformVoid
()
,
this
@FunctionNVarargBridgeLowering
.
context
.
ir
.
symbols
.
functionN
.
defaultType
this
@FunctionNVarargBridgeLowering
.
context
.
ir
.
symbols
.
functionN
.
defaultType
)
)
putValueArgument
(
0
,
irArray
(
irSymbols
.
array
.
typeWith
(
context
.
irBuiltIns
.
anyNType
))
{
putValueArgument
(
0
,
irArray
(
irSymbols
.
array
.
typeWith
(
context
.
irBuiltIns
.
anyNType
))
{
(
0
until
expression
.
valueArgumentsCount
).
forEach
{
+
expression
.
getValueArgument
(
it
)
!!
}
(
0
until
expression
.
valueArgumentsCount
).
forEach
{
+
expression
.
getValueArgument
(
it
)
!!
.
transformVoid
()
}
})
})
}
}
}
}
}
}
private
fun
IrExpression
.
transformVoid
()
=
transform
(
this
@FunctionNVarargBridgeLowering
,
null
)
override
fun
visitClassNew
(
declaration
:
IrClass
):
IrStatement
{
override
fun
visitClassNew
(
declaration
:
IrClass
):
IrStatement
{
val
bigArityFunctionSuperTypes
=
declaration
.
superTypes
.
filterIsInstance
<
IrSimpleType
>().
filter
{
val
bigArityFunctionSuperTypes
=
declaration
.
superTypes
.
filterIsInstance
<
IrSimpleType
>().
filter
{
it
.
isFunctionType
&&
it
.
arguments
.
size
>
BuiltInFunctionArity
.
BIG_ARITY
it
.
isFunctionType
&&
it
.
arguments
.
size
>
BuiltInFunctionArity
.
BIG_ARITY
...
...
compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt
0 → 100644
浏览文件 @
4c3ffc34
interface
A
object
O
:
A
typealias
F
<
T
>
=
(
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
A
,
T
)
->
String
fun
test
(
f
:
F
<
F
<
String
>>):
String
=
f
(
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
)
{
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
s
->
s
}
fun
box
():
String
{
return
test
{
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
f
->
f
(
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
O
,
"OK"
)
}
}
\ No newline at end of file
compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java
浏览文件 @
4c3ffc34
...
@@ -13972,6 +13972,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
...
@@ -13972,6 +13972,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
}
}
@TestMetadata("nestedBigArityFunCalls.kt")
public void testNestedBigArityFunCalls() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
}
@TestMetadata("subclass.kt")
@TestMetadata("subclass.kt")
public void testSubclass() throws Exception {
public void testSubclass() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java
浏览文件 @
4c3ffc34
...
@@ -13972,6 +13972,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
...
@@ -13972,6 +13972,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
}
}
@TestMetadata("nestedBigArityFunCalls.kt")
public void testNestedBigArityFunCalls() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
}
@TestMetadata("subclass.kt")
@TestMetadata("subclass.kt")
public void testSubclass() throws Exception {
public void testSubclass() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java
浏览文件 @
4c3ffc34
...
@@ -12572,6 +12572,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
...
@@ -12572,6 +12572,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/javaLambda.kt");
}
}
@TestMetadata("nestedBigArityFunCalls.kt")
public void testNestedBigArityFunCalls() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
}
@TestMetadata("subclass.kt")
@TestMetadata("subclass.kt")
public void testSubclass() throws Exception {
public void testSubclass() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
浏览文件 @
4c3ffc34
...
@@ -10787,6 +10787,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
...
@@ -10787,6 +10787,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/functions/bigArity/invokeMemberCallableReference.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/invokeMemberCallableReference.kt");
}
}
@TestMetadata("nestedBigArityFunCalls.kt")
public void testNestedBigArityFunCalls() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
}
@TestMetadata("subclass.kt")
@TestMetadata("subclass.kt")
public void testSubclass() throws Exception {
public void testSubclass() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java
浏览文件 @
4c3ffc34
...
@@ -10787,6 +10787,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
...
@@ -10787,6 +10787,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/functions/bigArity/invokeMemberCallableReference.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/invokeMemberCallableReference.kt");
}
}
@TestMetadata("nestedBigArityFunCalls.kt")
public void testNestedBigArityFunCalls() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
}
@TestMetadata("subclass.kt")
@TestMetadata("subclass.kt")
public void testSubclass() throws Exception {
public void testSubclass() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java
浏览文件 @
4c3ffc34
...
@@ -10787,6 +10787,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
...
@@ -10787,6 +10787,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/functions/bigArity/invokeMemberCallableReference.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/invokeMemberCallableReference.kt");
}
}
@TestMetadata("nestedBigArityFunCalls.kt")
public void testNestedBigArityFunCalls() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
}
@TestMetadata("subclass.kt")
@TestMetadata("subclass.kt")
public void testSubclass() throws Exception {
public void testSubclass() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
runTest("compiler/testData/codegen/box/functions/bigArity/subclass.kt");
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
浏览文件 @
4c3ffc34
...
@@ -5461,6 +5461,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
...
@@ -5461,6 +5461,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
public void testAllFilesPresentInBigArity() throws Exception {
public void testAllFilesPresentInBigArity() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/functions/bigArity"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/functions/bigArity"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
}
@TestMetadata("nestedBigArityFunCalls.kt")
public void testNestedBigArityFunCalls() throws Exception {
runTest("compiler/testData/codegen/box/functions/bigArity/nestedBigArityFunCalls.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/box/functions/functionExpression")
@TestMetadata("compiler/testData/codegen/box/functions/functionExpression")
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录