IR: don't use descriptors in rendering (work in progress)

There's some descriptor-based code remaining. Need some more work on IR.
This commit is contained in:
Dmitry Petrov
2019-03-14 14:17:26 +03:00
parent bd3d5a9dbb
commit e49eae528c
319 changed files with 18613 additions and 18703 deletions
@@ -1,97 +1,97 @@
FILE fqName:<root> fileName:/arrayAugmentedAssignment1.kt
FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray flags:
FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray flags:[]
BLOCK_BODY
RETURN type=kotlin.Nothing from='foo(): IntArray'
CALL 'intArrayOf(vararg Int): IntArray' type=kotlin.IntArray origin=null
RETURN type=kotlin.Nothing from='FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray flags:[]'
CALL 'FUN IR_EXTERNAL_DECLARATION_STUB name:intArrayOf visibility:public modality:FINAL <> (elements:kotlin.IntArray) returnType:kotlin.IntArray flags:[]' type=kotlin.IntArray origin=null
elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int
CONST Int type=kotlin.Int value=1
CONST Int type=kotlin.Int value=2
CONST Int type=kotlin.Int value=3
FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int flags:
FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int flags:[]
BLOCK_BODY
RETURN type=kotlin.Nothing from='bar(): Int'
RETURN type=kotlin.Nothing from='FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int flags:[]'
CONST Int type=kotlin.Int value=42
CLASS CLASS name:C modality:FINAL visibility:public flags: superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:C flags:
CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:C flags:primary
VALUE_PARAMETER name:x index:0 type:kotlin.IntArray flags:
CLASS CLASS name:C modality:FINAL visibility:public flags:[] superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C flags:[]
CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:<root>.C flags:[primary]
VALUE_PARAMETER name:x index:0 type:kotlin.IntArray flags:[]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='C'
PROPERTY name:x visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:public flags:final
DELEGATING_CONSTRUCTOR_CALL 'CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public <> () returnType:kotlin.Any flags:[primary]'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public flags:[] superTypes:[kotlin.Any]'
PROPERTY name:x visibility:public modality:FINAL flags:[val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:public flags:[final]
EXPRESSION_BODY
GET_VAR 'value-parameter x: IntArray' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:C) returnType:kotlin.IntArray flags:
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL flags:val
$this: VALUE_PARAMETER name:<this> type:C flags:
GET_VAR 'VALUE_PARAMETER name:x index:0 type:kotlin.IntArray flags:[]' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.IntArray flags:[]
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL flags:[val]
$this: VALUE_PARAMETER name:<this> type:<root>.C flags:[]
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): IntArray'
GET_FIELD 'x: IntArray' type=kotlin.IntArray origin=null
receiver: GET_VAR 'this@C: C' type=C origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags:
RETURN type=kotlin.Nothing from='FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.IntArray flags:[]'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:public flags:[final]' type=kotlin.IntArray origin=null
receiver: GET_VAR 'VALUE_PARAMETER name:<this> type:<root>.C flags:[]' type=<root>.C origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags:[]
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags:
FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags:[]
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:[]
VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags:[]
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags:[]
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags:
FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags:[]
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:[]
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags:[]
overridden:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags:
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:
FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit flags:
FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags:[]
$this: VALUE_PARAMETER name:<this> type:kotlin.Any flags:[]
FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit flags:[]
BLOCK_BODY
VAR name:x type:kotlin.IntArray flags:var
CALL 'foo(): IntArray' type=kotlin.IntArray origin=null
VAR name:x type:kotlin.IntArray flags:[var]
CALL 'FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray flags:[]' type=kotlin.IntArray origin=null
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:val
GET_VAR 'x: IntArray' type=kotlin.IntArray origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:val
VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:[val]
GET_VAR 'VAR name:x type:kotlin.IntArray flags:[var]' type=kotlin.IntArray origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:[val]
CONST Int type=kotlin.Int value=0
CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=PLUSEQ
$this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null
index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null
value: CALL 'plus(Int): Int' type=kotlin.Int origin=PLUSEQ
$this: CALL 'get(Int): Int' type=kotlin.Int origin=PLUSEQ
$this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null
index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null
CALL 'FUN IR_EXTERNAL_DECLARATION_STUB name:set visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit flags:[]' type=kotlin.Unit origin=PLUSEQ
$this: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:[val]' type=kotlin.IntArray origin=null
index: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:[val]' type=kotlin.Int origin=null
value: CALL 'FUN IR_EXTERNAL_DECLARATION_STUB name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int flags:[]' type=kotlin.Int origin=PLUSEQ
$this: CALL 'FUN IR_EXTERNAL_DECLARATION_STUB name:get visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int) returnType:kotlin.Int flags:[]' type=kotlin.Int origin=PLUSEQ
$this: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:[val]' type=kotlin.IntArray origin=null
index: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:[val]' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=1
FUN name:testCall visibility:public modality:FINAL <> () returnType:kotlin.Unit flags:
FUN name:testCall visibility:public modality:FINAL <> () returnType:kotlin.Unit flags:[]
BLOCK_BODY
BLOCK type=kotlin.Unit origin=MULTEQ
VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:val
CALL 'foo(): IntArray' type=kotlin.IntArray origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:val
CALL 'bar(): Int' type=kotlin.Int origin=null
CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=MULTEQ
$this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null
index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null
value: CALL 'times(Int): Int' type=kotlin.Int origin=MULTEQ
$this: CALL 'get(Int): Int' type=kotlin.Int origin=MULTEQ
$this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null
index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:[val]
CALL 'FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray flags:[]' type=kotlin.IntArray origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:[val]
CALL 'FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int flags:[]' type=kotlin.Int origin=null
CALL 'FUN IR_EXTERNAL_DECLARATION_STUB name:set visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit flags:[]' type=kotlin.Unit origin=MULTEQ
$this: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:[val]' type=kotlin.IntArray origin=null
index: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:[val]' type=kotlin.Int origin=null
value: CALL 'FUN IR_EXTERNAL_DECLARATION_STUB name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int flags:[]' type=kotlin.Int origin=MULTEQ
$this: CALL 'FUN IR_EXTERNAL_DECLARATION_STUB name:get visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int) returnType:kotlin.Int flags:[]' type=kotlin.Int origin=MULTEQ
$this: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:[val]' type=kotlin.IntArray origin=null
index: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:[val]' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=2
FUN name:testMember visibility:public modality:FINAL <> (c:C) returnType:kotlin.Unit flags:
VALUE_PARAMETER name:c index:0 type:C flags:
FUN name:testMember visibility:public modality:FINAL <> (c:<root>.C) returnType:kotlin.Unit flags:[]
VALUE_PARAMETER name:c index:0 type:<root>.C flags:[]
BLOCK_BODY
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
typeOperand: CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public flags: superTypes:[kotlin.Any]
typeOperand: CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public flags:[] superTypes:[kotlin.Any]
BLOCK type=kotlin.Int origin=POSTFIX_INCR
VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:val
CALL '<get-x>(): IntArray' type=kotlin.IntArray origin=GET_PROPERTY
$this: GET_VAR 'value-parameter c: C' type=C origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:val
VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:[val]
CALL 'FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.IntArray flags:[]' type=kotlin.IntArray origin=GET_PROPERTY
$this: GET_VAR 'VALUE_PARAMETER name:c index:0 type:<root>.C flags:[]' type=<root>.C origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:[val]
CONST Int type=kotlin.Int value=0
VAR IR_TEMPORARY_VARIABLE name:tmp2 type:kotlin.Int flags:val
CALL 'get(Int): Int' type=kotlin.Int origin=POSTFIX_INCR
$this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null
index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null
CALL 'set(Int, Int): Unit' type=kotlin.Unit origin=POSTFIX_INCR
$this: GET_VAR 'tmp0_array: IntArray' type=kotlin.IntArray origin=null
index: GET_VAR 'tmp1_index0: Int' type=kotlin.Int origin=null
value: CALL 'inc(): Int' type=kotlin.Int origin=POSTFIX_INCR
$this: GET_VAR 'tmp2: Int' type=kotlin.Int origin=null
GET_VAR 'tmp2: Int' type=kotlin.Int origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp2 type:kotlin.Int flags:[val]
CALL 'FUN IR_EXTERNAL_DECLARATION_STUB name:get visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int) returnType:kotlin.Int flags:[]' type=kotlin.Int origin=POSTFIX_INCR
$this: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:[val]' type=kotlin.IntArray origin=null
index: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:[val]' type=kotlin.Int origin=null
CALL 'FUN IR_EXTERNAL_DECLARATION_STUB name:set visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit flags:[]' type=kotlin.Unit origin=POSTFIX_INCR
$this: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp0_array type:kotlin.IntArray flags:[val]' type=kotlin.IntArray origin=null
index: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp1_index0 type:kotlin.Int flags:[val]' type=kotlin.Int origin=null
value: CALL 'FUN IR_EXTERNAL_DECLARATION_STUB name:inc visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int flags:[]' type=kotlin.Int origin=POSTFIX_INCR
$this: GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp2 type:kotlin.Int flags:[val]' type=kotlin.Int origin=null
GET_VAR 'VAR IR_TEMPORARY_VARIABLE name:tmp2 type:kotlin.Int flags:[val]' type=kotlin.Int origin=null