Rematerialize simple expressions (local variables, literals, $this, $receiver) when generating calls.

This commit is contained in:
Dmitry Petrov
2016-08-17 13:09:59 +03:00
committed by Dmitry Petrov
parent c1583c4368
commit 287d804131
10 changed files with 118 additions and 46 deletions
+9 -15
View File
@@ -10,27 +10,21 @@ IrFile /arrayAugmentedAssignment1.kt
BLOCK type=<no-type> hasResult=false isDesugared=false
VAR var x: kotlin.IntArray
CALL .foo type=kotlin.IntArray operator=
VAR val tmp0_array: kotlin.IntArray
GET_VAR x type=kotlin.IntArray
VAR val tmp1_index0: kotlin.Int
LITERAL Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=PLUSEQ
$this: GET_VAR tmp0_array type=kotlin.IntArray
index: GET_VAR tmp1_index0 type=kotlin.Int
$this: GET_VAR x type=kotlin.IntArray
index: LITERAL Int type=kotlin.Int value='0'
value: CALL .plus type=kotlin.Int operator=PLUSEQ
$this: CALL .get type=kotlin.Int operator=PLUSEQ
$this: GET_VAR tmp0_array type=kotlin.IntArray
index: GET_VAR tmp1_index0 type=kotlin.Int
$this: GET_VAR x type=kotlin.IntArray
index: LITERAL Int type=kotlin.Int value='0'
other: LITERAL Int type=kotlin.Int value='1'
VAR val tmp2_array: kotlin.IntArray
VAR val tmp0_array: kotlin.IntArray
CALL .foo type=kotlin.IntArray operator=
VAR val tmp3_index0: kotlin.Int
LITERAL Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=MULTEQ
$this: GET_VAR tmp2_array type=kotlin.IntArray
index: GET_VAR tmp3_index0 type=kotlin.Int
$this: GET_VAR tmp0_array type=kotlin.IntArray
index: LITERAL Int type=kotlin.Int value='0'
value: CALL .times type=kotlin.Int operator=MULTEQ
$this: CALL .get type=kotlin.Int operator=MULTEQ
$this: GET_VAR tmp2_array type=kotlin.IntArray
index: GET_VAR tmp3_index0 type=kotlin.Int
$this: GET_VAR tmp0_array type=kotlin.IntArray
index: LITERAL Int type=kotlin.Int value='0'
other: LITERAL Int type=kotlin.Int value='2'