about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2019-09-20 11:23:47 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2019-09-20 11:24:30 +1000
commit3eae7f6291677fea37bcf91fd42e435803eabebf (patch)
tree96698f24e32c90dd68afbacbfb6984fe1c0016e5 /src
parentacf7d4dcdba4046917c61aab141c1dec25669ce9 (diff)
downloadrust-3eae7f6291677fea37bcf91fd42e435803eabebf.tar.gz
rust-3eae7f6291677fea37bcf91fd42e435803eabebf.zip
Upgrade to ena-0.13.1 and use the new `inlined_probe_value` function.
This is a big speed win for `keccak` and `inflate`.
Diffstat (limited to 'src')
-rw-r--r--src/librustc/infer/mod.rs5
-rw-r--r--src/librustc/infer/type_variable.rs8
-rw-r--r--src/librustc_data_structures/Cargo.toml2
3 files changed, 11 insertions, 4 deletions
diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs
index eaef2198e3b..5d556485c15 100644
--- a/src/librustc/infer/mod.rs
+++ b/src/librustc/infer/mod.rs
@@ -1609,20 +1609,21 @@ impl<'a, 'tcx> ShallowResolver<'a, 'tcx> {
                 use self::type_variable::TypeVariableValue;
 
                 // See the comment in `shallow_resolve()`.
-                match self.infcx.type_variables.borrow_mut().probe(v) {
+                match self.infcx.type_variables.borrow_mut().inlined_probe(v) {
                     TypeVariableValue::Known { value: t } => self.fold_ty(t) != typ,
                     TypeVariableValue::Unknown { .. } => false,
                 }
             }
 
             ty::Infer(ty::IntVar(v)) => {
-                match self.infcx.int_unification_table.borrow_mut().probe_value(v) {
+                match self.infcx.int_unification_table.borrow_mut().inlined_probe_value(v) {
                     Some(v) => v.to_type(self.infcx.tcx) != typ,
                     None => false,
                 }
             }
 
             ty::Infer(ty::FloatVar(v)) => {
+                // Not `inlined_probe_value(v)` because this call site is colder.
                 match self.infcx.float_unification_table.borrow_mut().probe_value(v) {
                     Some(v) => v.to_type(self.infcx.tcx) != typ,
                     None => false,
diff --git a/src/librustc/infer/type_variable.rs b/src/librustc/infer/type_variable.rs
index e30e86998a8..dd09e9a8f58 100644
--- a/src/librustc/infer/type_variable.rs
+++ b/src/librustc/infer/type_variable.rs
@@ -234,7 +234,13 @@ impl<'tcx> TypeVariableTable<'tcx> {
     /// Retrieves the type to which `vid` has been instantiated, if
     /// any.
     pub fn probe(&mut self, vid: ty::TyVid) -> TypeVariableValue<'tcx> {
-        self.eq_relations.probe_value(vid)
+        self.inlined_probe(vid)
+    }
+
+    /// An always-inlined variant of `probe`, for very hot call sites.
+    #[inline(always)]
+    pub fn inlined_probe(&mut self, vid: ty::TyVid) -> TypeVariableValue<'tcx> {
+        self.eq_relations.inlined_probe_value(vid)
     }
 
     /// If `t` is a type-inference variable, and it has been
diff --git a/src/librustc_data_structures/Cargo.toml b/src/librustc_data_structures/Cargo.toml
index be9f79c83bb..ae3403cf0ce 100644
--- a/src/librustc_data_structures/Cargo.toml
+++ b/src/librustc_data_structures/Cargo.toml
@@ -10,7 +10,7 @@ path = "lib.rs"
 doctest = false
 
 [dependencies]
-ena = "0.13"
+ena = "0.13.1"
 indexmap = "1"
 log = "0.4"
 jobserver_crate = { version = "0.1.13", package = "jobserver" }