mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
For comparison intrinsics and for instanceof checks, make
it possible to get the the stack value produced and branch
on that directly instead of materializing a boolean to
branch on from it.
That reduces code such as
```
IF_CMPEQ L1
CONST_0
GOTO L2
L1: CONST_1
L2: IFEQ L3
```
to just one IF_CMP instruction.
17 lines
154 B
Kotlin
Vendored
17 lines
154 B
Kotlin
Vendored
val a = 1
|
|
|
|
fun main() {
|
|
if (a == 0) {
|
|
"then"
|
|
} else {
|
|
"else"
|
|
}
|
|
}
|
|
|
|
//0 ICONST_0
|
|
//1 ICONST_1
|
|
//0 IFEQ
|
|
//1 IFNE
|
|
//1 IF
|
|
//1 GOTO
|