JVM IR: link via descriptors instead of signatures by default
Doing so speeds up psi2ir ~2 times, and thus improves total compiler performance by about 6-8%. Unless JVM IR is in the mode where linking via signatures is the only way (-Xserialize-ir, -Xklib), signatures are actually not needed at all, SymbolTable can use the frontend representation (descriptors for FE1.0, and hopefully FIR elements for K2) as hash table keys. The only catch is that since other backends still need to work with signatures, all the common IR utilities, such as irTypePredicates.kt, need to work correctly for IR elements both with signatures and without. Also, introduce a fallback compiler flag -Xlink-via-signatures, in case something goes wrong, to be able to troubleshoot and workaround any issues. #KT-48233
This commit is contained in:
+9
-2
@@ -478,8 +478,8 @@ Also sets `-jvm-target` value equal to the selected JDK version"""
|
||||
|
||||
@Argument(
|
||||
value = "-Xtype-enhancement-improvements-strict-mode",
|
||||
description = "Enable strict mode for some improvements in the type enhancement for loaded Java types based on nullability annotations," +
|
||||
"including freshly supported reading of the type use annotations from class files. " +
|
||||
description = "Enable strict mode for some improvements in the type enhancement for loaded Java types based on nullability annotations,\n" +
|
||||
"including freshly supported reading of the type use annotations from class files.\n" +
|
||||
"See KT-45671 for more details"
|
||||
)
|
||||
var typeEnhancementImprovementsInStrictMode: Boolean by FreezableVar(false)
|
||||
@@ -509,6 +509,13 @@ Also sets `-jvm-target` value equal to the selected JDK version"""
|
||||
)
|
||||
var enhanceTypeParameterTypesToDefNotNull: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xlink-via-signatures",
|
||||
description = "Link JVM IR symbols via signatures, instead of descriptors. \n" +
|
||||
"This mode is slower, but can be useful in troubleshooting problems with the JVM IR backend"
|
||||
)
|
||||
var linkViaSignatures: Boolean by FreezableVar(false)
|
||||
|
||||
override fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap<AnalysisFlag<*>, Any> {
|
||||
val result = super.configureAnalysisFlags(collector, languageVersion)
|
||||
result[JvmAnalysisFlags.strictMetadataVersionSemantics] = strictMetadataVersionSemantics
|
||||
|
||||
Reference in New Issue
Block a user