Rebase rustc-rayon on rayon-1.2

See also https://github.com/rust-lang/rustc-rayon/pull/3
This commit is contained in:
Josh Stone 2019-09-10 10:13:07 -07:00
parent 59a31c8c67
commit 33c4125fbe
6 changed files with 53 additions and 19 deletions

View File

@ -659,6 +659,16 @@ dependencies = [
"crossbeam-utils 0.6.5",
]
[[package]]
name = "crossbeam-deque"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71"
dependencies = [
"crossbeam-epoch 0.7.2",
"crossbeam-utils 0.6.5",
]
[[package]]
name = "crossbeam-epoch"
version = "0.3.1"
@ -3074,8 +3084,8 @@ dependencies = [
"num_cpus",
"parking_lot 0.9.0",
"polonius-engine",
"rustc-rayon",
"rustc-rayon-core",
"rustc-rayon 0.3.0",
"rustc-rayon-core 0.3.0",
"rustc_apfloat",
"rustc_data_structures",
"rustc_errors",
@ -3123,8 +3133,8 @@ dependencies = [
"rustc-ap-graphviz",
"rustc-ap-serialize",
"rustc-hash",
"rustc-rayon",
"rustc-rayon-core",
"rustc-rayon 0.2.0",
"rustc-rayon-core 0.2.0",
"smallvec",
"stable_deref_trait",
]
@ -3263,7 +3273,18 @@ checksum = "0d2e07e19601f21c59aad953c2632172ba70cb27e685771514ea66e4062b3363"
dependencies = [
"crossbeam-deque 0.2.0",
"either",
"rustc-rayon-core",
"rustc-rayon-core 0.2.0",
]
[[package]]
name = "rustc-rayon"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f32767f90d938f1b7199a174ef249ae1924f6e5bbdb9d112fea141e016f25b3a"
dependencies = [
"crossbeam-deque 0.7.1",
"either",
"rustc-rayon-core 0.3.0",
]
[[package]]
@ -3278,6 +3299,19 @@ dependencies = [
"num_cpus",
]
[[package]]
name = "rustc-rayon-core"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea2427831f0053ea3ea73559c8eabd893133a51b251d142bacee53c62a288cb3"
dependencies = [
"crossbeam-deque 0.7.1",
"crossbeam-queue",
"crossbeam-utils 0.6.5",
"lazy_static 1.3.0",
"num_cpus",
]
[[package]]
name = "rustc-serialize"
version = "0.3.24"
@ -3398,8 +3432,8 @@ dependencies = [
"log",
"parking_lot 0.9.0",
"rustc-hash",
"rustc-rayon",
"rustc-rayon-core",
"rustc-rayon 0.3.0",
"rustc-rayon-core 0.3.0",
"rustc_index",
"serialize",
"smallvec",
@ -3479,7 +3513,7 @@ dependencies = [
"log",
"once_cell",
"rustc",
"rustc-rayon",
"rustc-rayon 0.3.0",
"rustc_codegen_ssa",
"rustc_codegen_utils",
"rustc_data_structures",
@ -3758,7 +3792,7 @@ version = "0.0.0"
dependencies = [
"minifier",
"pulldown-cmark 0.5.3",
"rustc-rayon",
"rustc-rayon 0.3.0",
"tempfile",
]

View File

@ -18,8 +18,8 @@ jobserver = "0.1"
num_cpus = "1.0"
scoped-tls = "1.0"
log = { version = "0.4", features = ["release_max_level_info", "std"] }
rustc-rayon = "0.2.0"
rustc-rayon-core = "0.2.0"
rustc-rayon = "0.3.0"
rustc-rayon-core = "0.3.0"
polonius-engine = "0.10.0"
rustc_apfloat = { path = "../librustc_apfloat" }
rustc_target = { path = "../librustc_target" }

View File

@ -20,8 +20,8 @@ graphviz = { path = "../libgraphviz" }
cfg-if = "0.1.2"
crossbeam-utils = { version = "0.6.5", features = ["nightly"] }
stable_deref_trait = "1.0.0"
rayon = { version = "0.2.0", package = "rustc-rayon" }
rayon-core = { version = "0.2.0", package = "rustc-rayon-core" }
rayon = { version = "0.3.0", package = "rustc-rayon" }
rayon-core = { version = "0.3.0", package = "rustc-rayon-core" }
rustc-hash = "1.0.1"
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
rustc_index = { path = "../librustc_index", package = "rustc_index" }

View File

@ -11,7 +11,7 @@ doctest = false
[dependencies]
log = "0.4"
rayon = { version = "0.2.0", package = "rustc-rayon" }
rayon = { version = "0.3.0", package = "rustc-rayon" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
syntax = { path = "../libsyntax" }
syntax_ext = { path = "../libsyntax_ext" }

View File

@ -202,7 +202,7 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
stderr: &Option<Arc<Mutex<Vec<u8>>>>,
f: F,
) -> R {
use rayon::{ThreadPool, ThreadPoolBuilder};
use rayon::{ThreadBuilder, ThreadPool, ThreadPoolBuilder};
let gcx_ptr = &Lock::new(0);
@ -225,20 +225,20 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
// the thread local rustc uses. syntax_globals and syntax_pos_globals are
// captured and set on the new threads. ty::tls::with_thread_locals sets up
// thread local callbacks from libsyntax
let main_handler = move |worker: &mut dyn FnMut()| {
let main_handler = move |thread: ThreadBuilder| {
syntax::GLOBALS.set(syntax_globals, || {
syntax_pos::GLOBALS.set(syntax_pos_globals, || {
if let Some(stderr) = stderr {
io::set_panic(Some(box Sink(stderr.clone())));
}
ty::tls::with_thread_locals(|| {
ty::tls::GCX_PTR.set(gcx_ptr, || worker())
ty::tls::GCX_PTR.set(gcx_ptr, || thread.run())
})
})
})
};
ThreadPool::scoped_pool(config, main_handler, with_pool).unwrap()
config.build_scoped(main_handler, with_pool).unwrap()
})
})
})

View File

@ -11,5 +11,5 @@ path = "lib.rs"
[dependencies]
pulldown-cmark = { version = "0.5.3", default-features = false }
minifier = "0.0.33"
rayon = { version = "0.2.0", package = "rustc-rayon" }
rayon = { version = "0.3.0", package = "rustc-rayon" }
tempfile = "3"