[cfe] Add benchmark tags for macro phases
Change-Id: I41553de77bac91c59c25cbbded6fca82e1ec0f44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234280
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/lib/src/fasta/kernel/benchmarker.dart b/pkg/front_end/lib/src/fasta/kernel/benchmarker.dart
index 7b52198..404b3ad 100644
--- a/pkg/front_end/lib/src/fasta/kernel/benchmarker.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/benchmarker.dart
@@ -122,6 +122,7 @@
outline_computeVariances,
outline_computeDefaultTypes,
outline_applyTypeMacros,
+ outline_buildMacroTypesForPhase1,
outline_checkSemantics,
outline_finishTypeVariables,
outline_createTypeInferenceEngine,
@@ -134,6 +135,8 @@
outline_buildClassHierarchy,
outline_checkSupertypes,
outline_applyDeclarationMacros,
+ outline_buildMacroDeclarationsForPhase1,
+ outline_buildMacroDeclarationsForPhase2,
outline_buildClassHierarchyMembers,
outline_computeHierarchy,
outline_computeShowHideElements,
@@ -156,6 +159,9 @@
body_finishNoSuchMethodForwarders,
body_collectSourceClasses,
body_applyDefinitionMacros,
+ body_buildMacroDefinitionsForPhase1,
+ body_buildMacroDefinitionsForPhase2,
+ body_buildMacroDefinitionsForPhase3,
body_finishNativeMethods,
body_finishPatchMethods,
body_finishAllConstructors,
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
index d3aa340..e5aa742 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -497,6 +497,8 @@
benchmarker?.enterPhase(BenchmarkPhases.outline_applyTypeMacros);
List<SourceLibraryBuilder> augmentationLibraries =
await macroApplications.applyTypeMacros();
+ benchmarker
+ ?.enterPhase(BenchmarkPhases.outline_buildMacroTypesForPhase1);
await _buildForPhase1(augmentationLibraries);
}
@@ -545,7 +547,11 @@
List<SourceLibraryBuilder> augmentationLibraries = [
augmentationLibrary
];
+ benchmarker?.enterPhase(
+ BenchmarkPhases.outline_buildMacroDeclarationsForPhase1);
await _buildForPhase1(augmentationLibraries);
+ benchmarker?.enterPhase(
+ BenchmarkPhases.outline_buildMacroDeclarationsForPhase2);
_buildForPhase2(augmentationLibraries);
});
}
@@ -636,8 +642,14 @@
benchmarker?.enterPhase(BenchmarkPhases.body_applyDefinitionMacros);
List<SourceLibraryBuilder> augmentationLibraries =
await macroApplications.applyDefinitionMacros();
+ benchmarker
+ ?.enterPhase(BenchmarkPhases.body_buildMacroDefinitionsForPhase1);
await _buildForPhase1(augmentationLibraries);
+ benchmarker
+ ?.enterPhase(BenchmarkPhases.body_buildMacroDefinitionsForPhase2);
_buildForPhase2(augmentationLibraries);
+ benchmarker
+ ?.enterPhase(BenchmarkPhases.body_buildMacroDefinitionsForPhase3);
_buildForPhase3(augmentationLibraries);
}