[JVM_IR] Use iinc for incrementing Int variables.
Fix line number generation for assignments where the right-hand side of the assignment is not on the same line. Fix line number generation for intrinsics functions where the function is not on the same line as the last argument. Be careful to not break stepping behavior with the iinc optimizations.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
fun main(args: Array<String>) {
|
||||
var i = 10
|
||||
|
||||
// -- 4 of these fit in iinc instructions
|
||||
i += 1
|
||||
i += 127
|
||||
i += 128
|
||||
i += -1
|
||||
i += -128
|
||||
i += -129
|
||||
|
||||
// -- 4 of these fit in iinc instructions
|
||||
i -= 1
|
||||
i -= 128
|
||||
i -= 129
|
||||
i -= -1
|
||||
i -= -127
|
||||
i -= -128
|
||||
|
||||
// -- 4 of these fit in iinc instructions
|
||||
i = i + 1
|
||||
i = i + 127
|
||||
i = i + 128
|
||||
i = i + -1
|
||||
i = i + -128
|
||||
i = i + -129
|
||||
|
||||
// -- 4 of these fit in iinc instructions
|
||||
i = i - 1
|
||||
i = i - 128
|
||||
i = i - 129
|
||||
i = i - -1
|
||||
i = i - -127
|
||||
i = i - -128
|
||||
}
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 16 IINC
|
||||
|
||||
// JVM_TEMPLATES
|
||||
// 0 IINC
|
||||
@@ -1,6 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// KT-36641 TODO Generate IINC instruction for prefix increment in JVM_IR
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
var i = 10
|
||||
++i
|
||||
|
||||
Reference in New Issue
Block a user