Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
d48f9277
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,发现更多精彩内容 >>
提交
d48f9277
编写于
1月 20, 2021
作者:
I
Ilmir Usmanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
JVM_IR: Do not unbox Result parameter in invoke if there is a bridge
since the bridge unboxes it. #KT-44141 Fixed
上级
0ddb603e
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
67 addition
and
1 deletion
+67
-1
compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java
...test/runners/codegen/FirBlackBoxCodegenTestGenerated.java
+6
-0
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt
...jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt
+10
-1
compiler/testData/codegen/box/inlineClasses/kt44141.kt
compiler/testData/codegen/box/inlineClasses/kt44141.kt
+14
-0
compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java
...in/test/runners/codegen/BlackBoxCodegenTestGenerated.java
+6
-0
compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java
.../test/runners/codegen/IrBlackBoxCodegenTestGenerated.java
+6
-0
compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java
...brains/kotlin/codegen/LightAnalysisModeTestGenerated.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/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java
浏览文件 @
d48f9277
...
@@ -16226,6 +16226,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
...
@@ -16226,6 +16226,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
}
}
@Test
@TestMetadata("kt44141.kt")
public void testKt44141() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt44141.kt");
}
@Test
@Test
@TestMetadata("mangledDefaultParameterFunction.kt")
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
public void testMangledDefaultParameterFunction() throws Exception {
compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt
浏览文件 @
d48f9277
...
@@ -629,6 +629,8 @@ class ExpressionCodegen(
...
@@ -629,6 +629,8 @@ class ExpressionCodegen(
if
(
irFunction
!
is
IrSimpleFunction
)
return
if
(
irFunction
!
is
IrSimpleFunction
)
return
// Skip Result's methods
// Skip Result's methods
if
(
irFunction
.
parentAsClass
.
fqNameWhenAvailable
==
StandardNames
.
RESULT_FQ_NAME
)
return
if
(
irFunction
.
parentAsClass
.
fqNameWhenAvailable
==
StandardNames
.
RESULT_FQ_NAME
)
return
// Do not unbox, if there is a bridge, which unboxes for us
if
(
hasBridge
())
return
val
index
=
(
arg
.
symbol
as
?
IrValueParameterSymbol
)
?.
owner
?.
index
?:
return
val
index
=
(
arg
.
symbol
as
?
IrValueParameterSymbol
)
?.
owner
?.
index
?:
return
val
genericOrAnyOverride
=
irFunction
.
overriddenSymbols
.
any
{
val
genericOrAnyOverride
=
irFunction
.
overriddenSymbols
.
any
{
...
@@ -637,7 +639,14 @@ class ExpressionCodegen(
...
@@ -637,7 +639,14 @@ class ExpressionCodegen(
}
||
irFunction
.
parentAsClass
.
origin
==
JvmLoweredDeclarationOrigin
.
LAMBDA_IMPL
}
||
irFunction
.
parentAsClass
.
origin
==
JvmLoweredDeclarationOrigin
.
LAMBDA_IMPL
if
(!
genericOrAnyOverride
)
return
if
(!
genericOrAnyOverride
)
return
StackValue
.
unboxInlineClass
(
OBJECT_TYPE
,
arg
.
type
.
toIrBasedKotlinType
(),
mv
)
StackValue
.
unboxInlineClass
(
OBJECT_TYPE
,
arg
.
type
.
erasedUpperBound
.
defaultType
.
toIrBasedKotlinType
(),
mv
)
}
private
fun
hasBridge
():
Boolean
=
irFunction
.
parentAsClass
.
declarations
.
any
{
function
->
function
is
IrFunction
&&
function
!=
irFunction
&&
context
.
methodSignatureMapper
.
mapSignatureSkipGeneric
(
function
).
let
{
it
.
asmMethod
.
name
==
signature
.
asmMethod
.
name
&&
it
.
valueParameters
==
signature
.
valueParameters
}
}
}
override
fun
visitFieldAccess
(
expression
:
IrFieldAccessExpression
,
data
:
BlockInfo
):
PromisedValue
{
override
fun
visitFieldAccess
(
expression
:
IrFieldAccessExpression
,
data
:
BlockInfo
):
PromisedValue
{
...
...
compiler/testData/codegen/box/inlineClasses/kt44141.kt
0 → 100644
浏览文件 @
d48f9277
// WITH_RUNTIME
// KJS_FULL_RUNTIME
fun
<
T
:
Result
<
*
>>
isSuccess
(
a
:
A
<
T
>):
String
=
a
.
go
{
it
.
isSuccess
}
class
A
<
T
>
{
fun
go
(
f
:
(
T
)
->
Boolean
):
String
=
if
(
f
(
Result
.
success
(
1
)
as
T
))
"OK"
else
"Fail"
}
fun
box
():
String
=
isSuccess
(
A
<
Result
<
Int
>>())
compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java
浏览文件 @
d48f9277
...
@@ -16226,6 +16226,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
...
@@ -16226,6 +16226,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
}
}
@Test
@TestMetadata("kt44141.kt")
public void testKt44141() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt44141.kt");
}
@Test
@Test
@TestMetadata("mangledDefaultParameterFunction.kt")
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
public void testMangledDefaultParameterFunction() throws Exception {
compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java
浏览文件 @
d48f9277
...
@@ -16226,6 +16226,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
...
@@ -16226,6 +16226,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
}
}
@Test
@TestMetadata("kt44141.kt")
public void testKt44141() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt44141.kt");
}
@Test
@Test
@TestMetadata("mangledDefaultParameterFunction.kt")
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
public void testMangledDefaultParameterFunction() throws Exception {
compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java
浏览文件 @
d48f9277
...
@@ -14222,6 +14222,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
...
@@ -14222,6 +14222,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
}
}
@TestMetadata("kt44141.kt")
public void testKt44141() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt44141.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
浏览文件 @
d48f9277
...
@@ -12177,6 +12177,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
...
@@ -12177,6 +12177,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
}
}
@TestMetadata("kt44141.kt")
public void testKt44141() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt44141.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java
浏览文件 @
d48f9277
...
@@ -12177,6 +12177,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
...
@@ -12177,6 +12177,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
}
}
@TestMetadata("kt44141.kt")
public void testKt44141() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt44141.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java
浏览文件 @
d48f9277
...
@@ -12242,6 +12242,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
...
@@ -12242,6 +12242,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
}
}
@TestMetadata("kt44141.kt")
public void testKt44141() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt44141.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
浏览文件 @
d48f9277
...
@@ -6648,6 +6648,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
...
@@ -6648,6 +6648,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
runTest("compiler/testData/codegen/box/inlineClasses/kt38680b.kt");
}
}
@TestMetadata("kt44141.kt")
public void testKt44141() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/kt44141.kt");
}
@TestMetadata("mangledDefaultParameterFunction.kt")
@TestMetadata("mangledDefaultParameterFunction.kt")
public void testMangledDefaultParameterFunction() throws Exception {
public void testMangledDefaultParameterFunction() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt");
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录