[JVM_IR] Fix offsets in constant propagation optimization.
Loads of temporary variables that contain constants are replaced with a copy of the constant. This avoids locals loads and stores. However, the copy of the constant needs to have the offset of the load and not of the original constant. Fixes KT-41963.
This commit is contained in:
committed by
Alexander Udalov
parent
f273edeb8e
commit
78483930bc
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
LineBreakpoint created at stepOverWhenWithInline.kt:5
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
stepOverWhenWithInline.kt:5
|
||||
stepOverWhenWithInline.kt:7
|
||||
stepOverWhenWithInline.kt:8
|
||||
stepOverWhenWithInline.kt:9
|
||||
stepOverWhenWithInline.kt:7
|
||||
stepOverWhenWithInline.kt:13
|
||||
stepOverWhenWithInline.kt:14
|
||||
stepOverWhenWithInline.kt:17
|
||||
stepOverWhenWithInline.kt:18
|
||||
stepOverWhenWithInline.kt:13
|
||||
stepOverWhenWithInline.kt:25
|
||||
stepOverWhenWithInline.kt:26
|
||||
stepOverWhenWithInline.kt:27
|
||||
stepOverWhenWithInline.kt:25
|
||||
stepOverWhenWithInline.kt:32
|
||||
stepOverWhenWithInline.kt:33
|
||||
stepOverWhenWithInline.kt:34
|
||||
stepOverWhenWithInline.kt:32
|
||||
stepOverWhenWithInline.kt:38
|
||||
stepOverWhenWithInline.kt:39
|
||||
stepOverWhenWithInline.kt:42
|
||||
stepOverWhenWithInline.kt:43
|
||||
stepOverWhenWithInline.kt:38
|
||||
stepOverWhenWithInline.kt:51
|
||||
stepOverWhenWithInline.kt:52
|
||||
stepOverWhenWithInline.kt:51
|
||||
stepOverWhenWithInline.kt:57
|
||||
stepOverWhenWithInline.kt:58
|
||||
stepOverWhenWithInline.kt:57
|
||||
stepOverWhenWithInline.kt:63
|
||||
stepOverWhenWithInline.kt:64
|
||||
stepOverWhenWithInline.kt:65
|
||||
stepOverWhenWithInline.kt:63
|
||||
stepOverWhenWithInline.kt:75
|
||||
stepOverWhenWithInline.kt:76
|
||||
stepOverWhenWithInline.kt:75
|
||||
stepOverWhenWithInline.kt:80
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
+4
-1
@@ -86,4 +86,7 @@ inline fun foo(f: () -> Int): Int {
|
||||
|
||||
fun test(i: Int) = i
|
||||
|
||||
// STEP_OVER: 32
|
||||
// STEP_OVER: 36
|
||||
|
||||
// JVM_IR and JVM backends have different heuristics for when to use a table switch.
|
||||
// This results is minor differences in step over behavior.
|
||||
+1
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
LineBreakpoint created at stepOverWhenWithInline.kt:5
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
@@ -35,6 +34,7 @@ stepOverWhenWithInline.kt:63
|
||||
stepOverWhenWithInline.kt:75
|
||||
stepOverWhenWithInline.kt:76
|
||||
stepOverWhenWithInline.kt:75
|
||||
stepOverWhenWithInline.kt:80
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
|
||||
Reference in New Issue
Block a user