about summary refs log tree commit diff
path: root/src/librustc/session
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-02-25 10:58:54 -0500
committerNiko Matsakis <niko@alum.mit.edu>2018-03-13 11:22:05 -0400
commit3a50b41da4cbb135fc74cdc8ebf2b09edb396f87 (patch)
tree2077454061d7c42a70d684158228ccc3a5ffd13b /src/librustc/session
parent8c024fdafb6339c5375543ef400a33419d65a19b (diff)
downloadrust-3a50b41da4cbb135fc74cdc8ebf2b09edb396f87.tar.gz
rust-3a50b41da4cbb135fc74cdc8ebf2b09edb396f87.zip
introduce `infcx.at(..).normalize(..)` operation [VIC]
It is backed by the new `normalize_projection_ty` query, which uses
canonicalization.
Diffstat (limited to 'src/librustc/session')
-rw-r--r--src/librustc/session/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs
index 7b4211e487a..b986445ff84 100644
--- a/src/librustc/session/mod.rs
+++ b/src/librustc/session/mod.rs
@@ -175,6 +175,11 @@ pub struct PerfStats {
     pub decode_def_path_tables_time: Cell<Duration>,
     /// Total number of values canonicalized queries constructed.
     pub queries_canonicalized: Cell<usize>,
+    /// Number of times we canonicalized a value and found that the
+    /// result had already been canonicalized.
+    pub canonicalized_values_allocated: Cell<usize>,
+    /// Number of times this query is invoked.
+    pub normalize_projection_ty: Cell<usize>,
 }
 
 /// Enum to support dispatch of one-time diagnostics (in Session.diag_once)
@@ -862,6 +867,10 @@ impl Session {
         );
         println!("Total queries canonicalized:                   {}",
                  self.perf_stats.queries_canonicalized.get());
+        println!("Total canonical values interned:               {}",
+                 self.perf_stats.canonicalized_values_allocated.get());
+        println!("normalize_projection_ty:                       {}",
+                 self.perf_stats.normalize_projection_ty.get());
     }
 
     /// We want to know if we're allowed to do an optimization for crate foo from -z fuel=foo=n.
@@ -1149,6 +1158,8 @@ pub fn build_session_(
             symbol_hash_time: Cell::new(Duration::from_secs(0)),
             decode_def_path_tables_time: Cell::new(Duration::from_secs(0)),
             queries_canonicalized: Cell::new(0),
+            canonicalized_values_allocated: Cell::new(0),
+            normalize_projection_ty: Cell::new(0),
         },
         code_stats: RefCell::new(CodeStats::new()),
         optimization_fuel_crate,