Fixed tiering docs

This commit is contained in:
Syrus
2019-12-20 19:12:35 -08:00
parent c143bc8fc8
commit 0f45bd4f0d

View File

@ -167,12 +167,14 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
let code_ptr = optimized let code_ptr = optimized
.module .module
.runnable_module .runnable_module
.borrow()
.get_code() .get_code()
.unwrap() .unwrap()
.as_ptr() as usize; .as_ptr() as usize;
let target_addresses: Vec<usize> = optimized let target_addresses: Vec<usize> = optimized
.module .module
.runnable_module .runnable_module
.borrow()
.get_local_function_offsets() .get_local_function_offsets()
.unwrap() .unwrap()
.into_iter() .into_iter()
@ -183,6 +185,7 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
baseline baseline
.module .module
.runnable_module .runnable_module
.borrow()
.patch_local_function(i - base, target_addresses[i - base]); .patch_local_function(i - base, target_addresses[i - base]);
} }
@ -209,17 +212,18 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
baseline.context_mut().local_functions = optimized.context_mut().local_functions; baseline.context_mut().local_functions = optimized.context_mut().local_functions;
} }
// Assuming we do not want to do breakpoint-based debugging on optimized backends. // Assuming we do not want to do breakpoint-based debugging on optimized backends.
let breakpoints = baseline.module.runnable_module.get_breakpoints(); let breakpoints = baseline.module.runnable_module.borrow().get_breakpoints();
let ctx = baseline.context_mut() as *mut _; let ctx = baseline.context_mut() as *mut _;
let ret = with_ctx(ctx, || { let ret = with_ctx(ctx, || {
if let Some(image) = resume_image.take() { if let Some(image) = resume_image.take() {
let msm = baseline let msm = baseline
.module .module
.runnable_module .runnable_module
.borrow()
.get_module_state_map() .get_module_state_map()
.unwrap(); .unwrap();
let code_base = let code_base =
baseline.module.runnable_module.get_code().unwrap().as_ptr() as usize; baseline.module.runnable_module.borrow().get_code().unwrap().as_ptr() as usize;
invoke_call_return_on_stack( invoke_call_return_on_stack(
&msm, &msm,
code_base, code_base,