mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-20 12:16:30 +00:00
Update remaining locations to use a &'static str for backend
This commit is contained in:
32
Cargo.lock
generated
32
Cargo.lock
generated
@ -558,7 +558,7 @@ dependencies = [
|
||||
"libc",
|
||||
"llvm-sys",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"parking_lot 0.10.0",
|
||||
"regex",
|
||||
]
|
||||
|
||||
@ -827,6 +827,17 @@ dependencies = [
|
||||
"md5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
"parking_lot_core 0.6.2",
|
||||
"rustc_version",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.10.0"
|
||||
@ -834,7 +845,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
"parking_lot_core",
|
||||
"parking_lot_core 0.7.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot_core"
|
||||
version = "0.6.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cloudabi",
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"rustc_version",
|
||||
"smallvec 0.6.13",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1800,7 +1826,7 @@ dependencies = [
|
||||
"libc",
|
||||
"nix",
|
||||
"page_size",
|
||||
"parking_lot",
|
||||
"parking_lot 0.9.0",
|
||||
"rustc_version",
|
||||
"serde",
|
||||
"serde-bench",
|
||||
|
@ -43,7 +43,7 @@ struct OptimizationState {
|
||||
}
|
||||
|
||||
struct OptimizationOutcome {
|
||||
backend_id: String,
|
||||
backend_id: &'static str,
|
||||
module: Module,
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ unsafe impl Sync for CtxWrapper {}
|
||||
|
||||
unsafe fn do_optimize(
|
||||
binary: &[u8],
|
||||
backend_id: String,
|
||||
backend_id: &'static str,
|
||||
compiler: Box<dyn Compiler>,
|
||||
ctx: &Mutex<CtxWrapper>,
|
||||
state: &OptimizationState,
|
||||
@ -87,8 +87,8 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
|
||||
import_object: &ImportObject,
|
||||
start_raw: extern "C" fn(&mut Ctx),
|
||||
baseline: &mut Instance,
|
||||
baseline_backend: String,
|
||||
optimized_backends: Vec<(String, Box<dyn Fn() -> Box<dyn Compiler> + Send>)>,
|
||||
baseline_backend: &'static str,
|
||||
optimized_backends: Vec<(&'static str, Box<dyn Fn() -> Box<dyn Compiler> + Send>)>,
|
||||
interactive_shell: F,
|
||||
) -> Result<(), String> {
|
||||
ensure_sighandler();
|
||||
@ -140,7 +140,7 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
|
||||
}));
|
||||
|
||||
loop {
|
||||
let new_optimized: Option<(String, &mut Instance)> = {
|
||||
let new_optimized: Option<(&'static str, &mut Instance)> = {
|
||||
let mut outcome = opt_state.outcome.lock().unwrap();
|
||||
if let Some(x) = outcome.take() {
|
||||
let instance = x
|
||||
|
@ -448,7 +448,7 @@ fn execute_wasi(
|
||||
&import_object,
|
||||
start_raw,
|
||||
&mut instance,
|
||||
options.backend,
|
||||
options.backend.to_string(),
|
||||
options
|
||||
.optimized_backends
|
||||
.iter()
|
||||
@ -456,7 +456,7 @@ fn execute_wasi(
|
||||
|&backend| -> (Backend, Box<dyn Fn() -> Box<dyn Compiler> + Send>) {
|
||||
let options = options.clone();
|
||||
(
|
||||
backend,
|
||||
backend.to_string(),
|
||||
Box::new(move || {
|
||||
get_compiler_by_backend(backend, &options).unwrap()
|
||||
}),
|
||||
|
Reference in New Issue
Block a user