Improved lint

This commit is contained in:
Syrus
2019-12-20 20:45:10 -08:00
parent c4d70a6b75
commit 1a960a01ae
3 changed files with 10 additions and 52 deletions

View File

@ -146,11 +146,9 @@ impl Instance {
/// Load an `Instance` using the given loader.
pub fn load<T: Loader>(&self, loader: T) -> ::std::result::Result<T::Instance, T::Error> {
loader.load(
&**self.module.runnable_module,
&self.module.info,
unsafe { &*self.inner.vmctx },
)
loader.load(&**self.module.runnable_module, &self.module.info, unsafe {
&*self.inner.vmctx
})
}
/// Through generic magic and the awe-inspiring power of traits, we bring you...

View File

@ -125,16 +125,9 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
msm: baseline
.module
.runnable_module
.borrow()
.get_module_state_map()
.unwrap(),
base: baseline
.module
.runnable_module
.borrow()
.get_code()
.unwrap()
.as_ptr() as usize,
base: baseline.module.runnable_module.get_code().unwrap().as_ptr() as usize,
backend: baseline_backend,
runnable_module: baseline.module.runnable_module.clone(),
});
@ -166,14 +159,12 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
let code_ptr = optimized
.module
.runnable_module
.borrow()
.get_code()
.unwrap()
.as_ptr() as usize;
let target_addresses: Vec<usize> = optimized
.module
.runnable_module
.borrow()
.get_local_function_offsets()
.unwrap()
.into_iter()
@ -184,7 +175,6 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
baseline
.module
.runnable_module
.borrow()
.patch_local_function(i - base, target_addresses[i - base]);
}
@ -193,13 +183,11 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
msm: optimized
.module
.runnable_module
.borrow()
.get_module_state_map()
.unwrap(),
base: optimized
.module
.runnable_module
.borrow()
.get_code()
.unwrap()
.as_ptr() as usize,
@ -218,16 +206,10 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
let msm = baseline
.module
.runnable_module
.borrow()
.get_module_state_map()
.unwrap();
let code_base = baseline
.module
.runnable_module
.borrow()
.get_code()
.unwrap()
.as_ptr() as usize;
let code_base =
baseline.module.runnable_module.get_code().unwrap().as_ptr() as usize;
invoke_call_return_on_stack(
&msm,
code_base,