Skip to content

Commit

Permalink
Fixed tiering docs
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Dec 21, 2019
1 parent c143bc8 commit 0f45bd4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/runtime-core/src/tiering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@ 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()
Expand All @@ -183,6 +185,7 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
baseline
.module
.runnable_module
.borrow()
.patch_local_function(i - base, target_addresses[i - base]);
}

Expand All @@ -209,17 +212,18 @@ pub unsafe fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
baseline.context_mut().local_functions = optimized.context_mut().local_functions;
}
// 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 ret = with_ctx(ctx, || {
if let Some(image) = resume_image.take() {
let msm = baseline
.module
.runnable_module
.borrow()
.get_module_state_map()
.unwrap();
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(
&msm,
code_base,
Expand Down

0 comments on commit 0f45bd4

Please sign in to comment.