]> git.lizzy.rs Git - rust.git/commitdiff
Upgrade to ena-0.13.1 and use the new `inlined_probe_value` function.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 20 Sep 2019 01:23:47 +0000 (11:23 +1000)
committerNicholas Nethercote <nnethercote@mozilla.com>
Fri, 20 Sep 2019 01:24:30 +0000 (11:24 +1000)
This is a big speed win for `keccak` and `inflate`.

Cargo.lock
src/librustc/infer/mod.rs
src/librustc/infer/type_variable.rs
src/librustc_data_structures/Cargo.toml

index f52e9738da8f97191531164828be2ffbee58bd77..78de3af2631d20cbf77c3536ec2b07c44502935d 100644 (file)
@@ -910,9 +910,9 @@ dependencies = [
 
 [[package]]
 name = "ena"
-version = "0.13.0"
+version = "0.13.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3dc01d68e08ca384955a3aeba9217102ca1aa85b6e168639bf27739f1d749d87"
+checksum = "8944dc8fa28ce4a38f778bd46bf7d923fe73eed5a439398507246c8e017e6f36"
 dependencies = [
  "log",
 ]
index eaef2198e3bcf3836925b43778313b6998765abd..5d556485c15f3b6bfbddd6729781ec04aba469ad 100644 (file)
@@ -1609,20 +1609,21 @@ pub fn shallow_resolve_changed(&mut self, typ: Ty<'tcx>) -> bool {
                 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,
index e30e86998a8c6f16bde7f8c1d8e932edb1380f31..dd09e9a8f58a40a7608dd5978d5537fddcdf8dea 100644 (file)
@@ -234,7 +234,13 @@ pub fn sub_unified(&mut self, a: ty::TyVid, b: ty::TyVid) -> bool {
     /// 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
index be9f79c83bb5a8416cf26cf41e73dff8b776dcc4..ae3403cf0ce9f6955b148f0fe10ede6d5300ecc2 100644 (file)
@@ -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" }