Shrinking IR: GetProperty / SetProperty expressions are now generated as calls.
This commit is contained in:
committed by
Dmitry Petrov
parent
8500f5ddb2
commit
70dfb75f82
+2
-2
@@ -14,6 +14,6 @@ IrFile /assignments.kt
|
||||
IrFunction public fun test2(/*0*/ r: Ref): kotlin.Unit
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
SET_PROPERTY .xtype=<no-type> operator=EQ
|
||||
CALL .<set-x> type=kotlin.Unit operator=EQ
|
||||
$this: GET_VAR r type=Ref operator=null
|
||||
$value: LITERAL Int type=kotlin.Int value='0'
|
||||
<set-?>: LITERAL Int type=kotlin.Int value='0'
|
||||
|
||||
+15
-15
@@ -30,23 +30,23 @@ IrFile /augmentedAssignment1.kt
|
||||
IrFunction public fun testProperty(): kotlin.Unit
|
||||
IrExpressionBody
|
||||
BLOCK type=kotlin.Int hasResult=true operator=null
|
||||
SET_PROPERTY .ptype=<no-type> operator=PLUSEQ
|
||||
$value: CALL .plus type=kotlin.Int operator=PLUSEQ
|
||||
$this: GET_PROPERTY .p type=kotlin.Int operator=PLUSEQ
|
||||
CALL .<set-p> type=kotlin.Unit operator=PLUSEQ
|
||||
<set-?>: CALL .plus type=kotlin.Int operator=PLUSEQ
|
||||
$this: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
|
||||
other: LITERAL Int type=kotlin.Int value='1'
|
||||
SET_PROPERTY .ptype=<no-type> operator=MINUSEQ
|
||||
$value: CALL .minus type=kotlin.Int operator=MINUSEQ
|
||||
$this: GET_PROPERTY .p type=kotlin.Int operator=MINUSEQ
|
||||
CALL .<set-p> type=kotlin.Unit operator=MINUSEQ
|
||||
<set-?>: CALL .minus type=kotlin.Int operator=MINUSEQ
|
||||
$this: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
|
||||
other: LITERAL Int type=kotlin.Int value='2'
|
||||
SET_PROPERTY .ptype=<no-type> operator=MULTEQ
|
||||
$value: CALL .times type=kotlin.Int operator=MULTEQ
|
||||
$this: GET_PROPERTY .p type=kotlin.Int operator=MULTEQ
|
||||
CALL .<set-p> type=kotlin.Unit operator=MULTEQ
|
||||
<set-?>: CALL .times type=kotlin.Int operator=MULTEQ
|
||||
$this: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
|
||||
other: LITERAL Int type=kotlin.Int value='3'
|
||||
SET_PROPERTY .ptype=<no-type> operator=DIVEQ
|
||||
$value: CALL .div type=kotlin.Int operator=DIVEQ
|
||||
$this: GET_PROPERTY .p type=kotlin.Int operator=DIVEQ
|
||||
CALL .<set-p> type=kotlin.Unit operator=DIVEQ
|
||||
<set-?>: CALL .div type=kotlin.Int operator=DIVEQ
|
||||
$this: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
|
||||
other: LITERAL Int type=kotlin.Int value='4'
|
||||
SET_PROPERTY .ptype=<no-type> operator=PERCEQ
|
||||
$value: CALL .mod type=kotlin.Int operator=PERCEQ
|
||||
$this: GET_PROPERTY .p type=kotlin.Int operator=PERCEQ
|
||||
CALL .<set-p> type=kotlin.Unit operator=PERCEQ
|
||||
<set-?>: CALL .mod type=kotlin.Int operator=PERCEQ
|
||||
$this: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
|
||||
other: LITERAL Int type=kotlin.Int value='5'
|
||||
|
||||
+5
-5
@@ -42,17 +42,17 @@ IrFile /augmentedAssignment2.kt
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
CALL .plusAssign type=kotlin.Unit operator=PLUSEQ
|
||||
$receiver: GET_PROPERTY .p type=A operator=PLUSEQ
|
||||
$receiver: CALL .<get-p> type=A operator=GET_PROPERTY
|
||||
s: LITERAL String type=kotlin.String value='+='
|
||||
CALL .minusAssign type=kotlin.Unit operator=MINUSEQ
|
||||
$receiver: GET_PROPERTY .p type=A operator=MINUSEQ
|
||||
$receiver: CALL .<get-p> type=A operator=GET_PROPERTY
|
||||
s: LITERAL String type=kotlin.String value='-='
|
||||
CALL .timesAssign type=kotlin.Unit operator=MULTEQ
|
||||
$receiver: GET_PROPERTY .p type=A operator=MULTEQ
|
||||
$receiver: CALL .<get-p> type=A operator=GET_PROPERTY
|
||||
s: LITERAL String type=kotlin.String value='*='
|
||||
CALL .divAssign type=kotlin.Unit operator=DIVEQ
|
||||
$receiver: GET_PROPERTY .p type=A operator=DIVEQ
|
||||
$receiver: CALL .<get-p> type=A operator=GET_PROPERTY
|
||||
s: LITERAL String type=kotlin.String value='/='
|
||||
CALL .modAssign type=kotlin.Unit operator=PERCEQ
|
||||
$receiver: GET_PROPERTY .p type=A operator=PERCEQ
|
||||
$receiver: CALL .<get-p> type=A operator=GET_PROPERTY
|
||||
s: LITERAL String type=kotlin.String value='%='
|
||||
|
||||
+2
-2
@@ -3,12 +3,12 @@ IrFile /dotQualified.kt
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
RETURN type=<no-type>
|
||||
GET_PROPERTY .length type=kotlin.Int operator=null
|
||||
CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
|
||||
$this: GET_VAR s type=kotlin.String operator=null
|
||||
IrFunction public fun lengthN(/*0*/ s: kotlin.String?): kotlin.Int?
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
RETURN type=<no-type>
|
||||
GET_PROPERTY ?.length type=kotlin.Int? operator=null
|
||||
CALL ?.<get-length> type=kotlin.Int? operator=GET_PROPERTY
|
||||
$this: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
|
||||
GET_VAR s type=kotlin.String? operator=null
|
||||
|
||||
@@ -9,5 +9,5 @@ IrFile /extensionPropertyGetterCall.kt
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
RETURN type=<no-type>
|
||||
GET_PROPERTY .okext type=kotlin.String operator=null
|
||||
CALL .<get-okext> type=kotlin.String operator=GET_PROPERTY
|
||||
$receiver: $RECEIVER of: test5 type=kotlin.String
|
||||
|
||||
+8
-8
@@ -34,17 +34,17 @@ IrFile /incrementDecrement.kt
|
||||
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_INCR
|
||||
VAR val tmp0: kotlin.Int
|
||||
CALL .inc type=kotlin.Int operator=PREFIX_INCR
|
||||
$this: GET_PROPERTY .p type=kotlin.Int operator=PREFIX_INCR
|
||||
SET_PROPERTY .ptype=<no-type> operator=PREFIX_INCR
|
||||
$value: GET_VAR tmp0 type=kotlin.Int operator=null
|
||||
$this: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
|
||||
CALL .<set-p> type=kotlin.Unit operator=PREFIX_INCR
|
||||
<set-?>: GET_VAR tmp0 type=kotlin.Int operator=null
|
||||
GET_VAR tmp0 type=kotlin.Int operator=null
|
||||
VAR val p2: kotlin.Int
|
||||
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_DECR
|
||||
VAR val tmp1: kotlin.Int
|
||||
CALL .dec type=kotlin.Int operator=PREFIX_DECR
|
||||
$this: GET_PROPERTY .p type=kotlin.Int operator=PREFIX_DECR
|
||||
SET_PROPERTY .ptype=<no-type> operator=PREFIX_DECR
|
||||
$value: GET_VAR tmp1 type=kotlin.Int operator=null
|
||||
$this: CALL .<get-p> type=kotlin.Int operator=GET_PROPERTY
|
||||
CALL .<set-p> type=kotlin.Unit operator=PREFIX_DECR
|
||||
<set-?>: GET_VAR tmp1 type=kotlin.Int operator=null
|
||||
GET_VAR tmp1 type=kotlin.Int operator=null
|
||||
IrFunction public fun testArray(): kotlin.Unit
|
||||
IrExpressionBody
|
||||
@@ -52,7 +52,7 @@ IrFile /incrementDecrement.kt
|
||||
VAR val a1: kotlin.Int
|
||||
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_INCR
|
||||
VAR val tmp0_array: kotlin.IntArray
|
||||
GET_PROPERTY .arr type=kotlin.IntArray operator=null
|
||||
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
|
||||
VAR val tmp1: kotlin.Int
|
||||
CALL .inc type=kotlin.Int operator=PREFIX_INCR
|
||||
$this: CALL .get type=kotlin.Int operator=PREFIX_INCR
|
||||
@@ -66,7 +66,7 @@ IrFile /incrementDecrement.kt
|
||||
VAR val a2: kotlin.Int
|
||||
BLOCK type=kotlin.Int hasResult=true operator=PREFIX_DECR
|
||||
VAR val tmp2_array: kotlin.IntArray
|
||||
GET_PROPERTY .arr type=kotlin.IntArray operator=null
|
||||
CALL .<get-arr> type=kotlin.IntArray operator=GET_PROPERTY
|
||||
VAR val tmp3: kotlin.Int
|
||||
CALL .dec type=kotlin.Int operator=PREFIX_DECR
|
||||
$this: CALL .get type=kotlin.Int operator=PREFIX_DECR
|
||||
|
||||
+4
-4
@@ -4,7 +4,7 @@ IrFile /references.kt
|
||||
LITERAL String type=kotlin.String value='OK'
|
||||
IrProperty public val ok2: kotlin.String = "OK" getter=null setter=null
|
||||
IrExpressionBody
|
||||
GET_PROPERTY .ok type=kotlin.String operator=null
|
||||
CALL .<get-ok> type=kotlin.String operator=GET_PROPERTY
|
||||
IrProperty public val ok3: kotlin.String getter=<get-ok3> setter=null
|
||||
IrPropertyGetter public fun <get-ok3>(): kotlin.String property=ok3
|
||||
IrExpressionBody
|
||||
@@ -15,7 +15,7 @@ IrFile /references.kt
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
RETURN type=<no-type>
|
||||
GET_PROPERTY .ok type=kotlin.String operator=null
|
||||
CALL .<get-ok> type=kotlin.String operator=GET_PROPERTY
|
||||
IrFunction public fun test2(/*0*/ x: kotlin.String): kotlin.String
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
@@ -32,7 +32,7 @@ IrFile /references.kt
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
RETURN type=<no-type>
|
||||
GET_PROPERTY .ok3 type=kotlin.String operator=null
|
||||
CALL .<get-ok3> type=kotlin.String operator=GET_PROPERTY
|
||||
IrProperty public val kotlin.String.okext: kotlin.String getter=<get-okext> setter=null
|
||||
IrPropertyGetter public fun kotlin.String.<get-okext>(): kotlin.String property=okext
|
||||
IrExpressionBody
|
||||
@@ -43,5 +43,5 @@ IrFile /references.kt
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
RETURN type=<no-type>
|
||||
GET_PROPERTY .okext type=kotlin.String operator=null
|
||||
CALL .<get-okext> type=kotlin.String operator=GET_PROPERTY
|
||||
$receiver: $RECEIVER of: test5 type=kotlin.String
|
||||
|
||||
+2
-2
@@ -23,14 +23,14 @@ IrFile /smartCasts.kt
|
||||
GET_VAR x type=kotlin.Any operator=null
|
||||
then: RETURN type=<no-type>
|
||||
CALL .println type=kotlin.Unit operator=null
|
||||
message: GET_PROPERTY .length type=kotlin.Int operator=null
|
||||
message: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
|
||||
$this: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
|
||||
GET_VAR x type=kotlin.Any operator=null
|
||||
CALL .expectsString type=kotlin.Unit operator=null
|
||||
s: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
|
||||
GET_VAR x type=kotlin.Any operator=null
|
||||
CALL .expectsInt type=kotlin.Unit operator=null
|
||||
i: GET_PROPERTY .length type=kotlin.Int operator=null
|
||||
i: CALL .<get-length> type=kotlin.Int operator=GET_PROPERTY
|
||||
$this: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.String
|
||||
GET_VAR x type=kotlin.Any operator=null
|
||||
CALL .expectsString type=kotlin.Unit operator=null
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ IrFile /values.kt
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
RETURN type=<no-type>
|
||||
GET_PROPERTY .a type=kotlin.Int operator=null
|
||||
CALL .<get-a> type=kotlin.Int operator=GET_PROPERTY
|
||||
IrFunction public fun test4(): Z.Companion
|
||||
IrExpressionBody
|
||||
BLOCK type=<no-type> hasResult=false operator=null
|
||||
|
||||
Reference in New Issue
Block a user