Psi2ir: do not sort descriptors for fake override generation

Descriptors are already supposed to be sorted in scopes. The problem is
that rendering descriptors for sorting takes a lot of time (~1.5% of
total compilation time of intellij with JVM IR), and simple heuristics,
like comparing by names first, don't fully help with it.

 #KT-48233
This commit is contained in:
Alexander Udalov
2021-08-26 00:11:00 +02:00
parent cc52832943
commit ffe0d9de70
59 changed files with 2205 additions and 2242 deletions
@@ -37,32 +37,6 @@ FILE fqName:<root> fileName:/C.kt
ENUM_ENTRY name:EA
init: EXPRESSION_BODY
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.E'
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<<root>.E>) returnType:kotlin.Any [fake_override]
overridden:
protected final fun clone (): kotlin.Any declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<<root>.E>) returnType:kotlin.Unit [fake_override]
overridden:
protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.E>) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] <root>.E?>? [fake_override]
overridden:
public final fun getDeclaringClass (): @[FlexibleNullability] java.lang.Class<@[FlexibleNullability] E of kotlin.Enum?>? declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.E>, other:<root>.E) returnType:kotlin.Int [fake_override,operator]
overridden:
public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
VALUE_PARAMETER name:other index:0 type:<root>.E
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.E>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.E>) returnType:kotlin.Int [fake_override]
overridden:
public final fun hashCode (): kotlin.Int declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
overridden:
public final name: kotlin.String [val]
@@ -79,6 +53,32 @@ FILE fqName:<root> fileName:/C.kt
overridden:
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<<root>.E>) returnType:kotlin.Any [fake_override]
overridden:
protected final fun clone (): kotlin.Any declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.E>, other:<root>.E) returnType:kotlin.Int [fake_override,operator]
overridden:
public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
VALUE_PARAMETER name:other index:0 type:<root>.E
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.E>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public final fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<<root>.E>) returnType:kotlin.Unit [fake_override]
overridden:
protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.E>) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] <root>.E?>? [fake_override]
overridden:
public final fun getDeclaringClass (): @[FlexibleNullability] java.lang.Class<@[FlexibleNullability] E of kotlin.Enum?>? declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.E>) returnType:kotlin.Int [fake_override]
overridden:
public final fun hashCode (): kotlin.Int declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.E>
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<<root>.E>) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Enum
@@ -234,16 +234,6 @@ FILE fqName:<root> fileName:/C.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.A'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[<root>.A]'
FUN FAKE_OVERRIDE name:test visibility:public modality:OPEN <> ($this:<root>.A) returnType:kotlin.Unit [fake_override]
annotations:
Annos(value = [Anno(token = 'OK')])
Strings(value = ['OK'])
Ints(value = ['42'])
Enums(value = [GET_ENUM 'ENUM_ENTRY name:EA' type=<root>.E])
Classes(value = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Double modality:FINAL visibility:public superTypes:[kotlin.Number; kotlin.Comparable<kotlin.Double>; java.io.Serializable]' type=kotlin.reflect.KClass<kotlin.Double>])
overridden:
public open fun test (): kotlin.Unit declared in <root>.A
$this: VALUE_PARAMETER name:<this> type:<root>.A
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.A
@@ -257,3 +247,13 @@ FILE fqName:<root> fileName:/C.kt
overridden:
public open fun toString (): kotlin.String [fake_override] declared in <root>.A
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:test visibility:public modality:OPEN <> ($this:<root>.A) returnType:kotlin.Unit [fake_override]
annotations:
Annos(value = [Anno(token = 'OK')])
Strings(value = ['OK'])
Ints(value = ['42'])
Enums(value = [GET_ENUM 'ENUM_ENTRY name:EA' type=<root>.E])
Classes(value = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Double modality:FINAL visibility:public superTypes:[kotlin.Number; kotlin.Comparable<kotlin.Double>; java.io.Serializable]' type=kotlin.reflect.KClass<kotlin.Double>])
overridden:
public open fun test (): kotlin.Unit declared in <root>.A
$this: VALUE_PARAMETER name:<this> type:<root>.A