@@ -18,6 +18,8 @@ pub type CompilationMetricsIndex = FxIndexMap<Option<CompileId>, Vec<Compilation
18
18
pub type StackIndex = FxHashMap < Option < CompileId > , StackSummary > ; // NB: attempt is always 0 here
19
19
pub type SymbolicShapeSpecializationIndex =
20
20
FxHashMap < Option < CompileId > , Vec < SymbolicShapeSpecializationMetadata > > ;
21
+ pub type GuardAddedFastIndex =
22
+ FxHashMap < Option < CompileId > , Vec < GuardAddedFastMetadata > > ;
21
23
22
24
pub type FxIndexMap < K , V > = IndexMap < K , V , BuildHasherDefault < FxHasher > > ;
23
25
@@ -63,11 +65,14 @@ impl StackTrieNode {
63
65
metrics_index : Option < & CompilationMetricsIndex > ,
64
66
) -> Result < String , fmt:: Error > {
65
67
let mut f = String :: new ( ) ;
68
+ write ! ( f, "<details>" ) ?;
69
+ write ! ( f, "<summary>Stack</summary>" ) ?;
66
70
write ! ( f, "<div class='stack-trie'>" ) ?;
67
71
write ! ( f, "<ul>" ) ?;
68
72
self . fmt_inner ( & mut f, metrics_index) ?;
69
73
write ! ( f, "</ul>" ) ?;
70
74
write ! ( f, "</div>" ) ?;
75
+ write ! ( f, "</details>" ) ?;
71
76
Ok ( f)
72
77
}
73
78
@@ -390,12 +395,18 @@ pub struct CompilationMetricsContext<'e> {
390
395
pub compile_id : String ,
391
396
pub stack_html : String ,
392
397
pub symbolic_shape_specializations : Vec < SymbolicShapeSpecializationContext > ,
398
+ pub guards_added_fast : Vec < GuardAddedFastContext > ,
393
399
pub output_files : & ' e Vec < OutputFile > ,
394
400
pub compile_id_dir : & ' e PathBuf ,
395
401
pub mini_stack_html : String ,
396
402
pub qps : & ' static str ,
397
403
}
398
404
405
+ #[ derive( Debug , Serialize ) ]
406
+ pub struct GuardsAddedFastContext {
407
+ pub guards : Vec < GuardAddedFastContext > ,
408
+ }
409
+
399
410
#[ derive( Debug , Serialize ) ]
400
411
pub enum FailureReason {
401
412
Failure ( ( String , String , String , u32 ) ) , // (failure type, failure reason, user frame filename, user frame lineno)
@@ -452,13 +463,21 @@ pub enum Metadata<'e> {
452
463
BwdCompilationMetrics ( & ' e BwdCompilationMetricsMetadata ) ,
453
464
Artifact ( & ' e ArtifactMetadata ) ,
454
465
DumpFile ( & ' e DumpFileMetadata ) ,
466
+ GuardAddedFast ( & ' e GuardAddedFastMetadata ) ,
455
467
}
456
468
457
469
#[ derive( Debug , Deserialize , Serialize ) ]
458
470
pub struct DumpFileMetadata {
459
471
pub name : String ,
460
472
}
461
473
474
+ #[ derive( Debug , Deserialize , Serialize ) ]
475
+ pub struct GuardAddedFastMetadata {
476
+ pub expr : Option < String > ,
477
+ pub stack : Option < StackSummary > ,
478
+ pub user_stack : Option < StackSummary > ,
479
+ }
480
+
462
481
#[ derive( Debug , Deserialize ) ]
463
482
pub struct Envelope {
464
483
pub rank : Option < u32 > ,
@@ -496,6 +515,7 @@ pub struct Envelope {
496
515
pub describe_source : Option < SourceDesc > ,
497
516
pub dump_file : Option < DumpFileMetadata > ,
498
517
pub chromium_event : Option < EmptyMetadata > ,
518
+ pub guard_added_fast : Option < GuardAddedFastMetadata > ,
499
519
#[ serde( flatten) ]
500
520
pub _other : FxHashMap < String , Value > ,
501
521
}
@@ -618,3 +638,10 @@ pub struct SymbolicShapeSpecializationContext {
618
638
pub user_stack_html : String ,
619
639
pub stack_html : String ,
620
640
}
641
+
642
+ #[ derive( Debug , Serialize ) ]
643
+ pub struct GuardAddedFastContext {
644
+ pub expr : String ,
645
+ pub user_stack_html : String ,
646
+ pub stack_html : String ,
647
+ }
0 commit comments