Re-enable snapshotting.

This commit is contained in:
losfair
2019-08-16 13:08:10 -07:00
parent be4ea764a0
commit dbaa000e96
3 changed files with 8 additions and 16 deletions

View File

@ -768,7 +768,7 @@ pub mod x64 {
let mut results: Vec<WasmFunctionStateDump> = vec![]; let mut results: Vec<WasmFunctionStateDump> = vec![];
let mut was_baseline = true; let mut was_baseline = true;
for i in 0.. { for _ in 0.. {
let ret_addr = initial_address.take().unwrap_or_else(|| { let ret_addr = initial_address.take().unwrap_or_else(|| {
let x = *stack; let x = *stack;
stack = stack.offset(1); stack = stack.offset(1);

View File

@ -184,7 +184,7 @@ pub 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;
} }
// TODO: Fix this for optimized version. // 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.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, || {
@ -209,15 +209,15 @@ pub fn run_tiering<F: Fn(InteractiveShellContext) -> ShellExitOperation>(
} }
}); });
if let Err(e) = ret { if let Err(e) = ret {
if let Some(new_image) = e.downcast_ref::<InstanceImage>() { if let Ok(new_image) = e.downcast::<InstanceImage>() {
// Tier switch event // Tier switch event
if !was_sigint_triggered_fault() && opt_state.outcome.lock().unwrap().is_some() if !was_sigint_triggered_fault() && opt_state.outcome.lock().unwrap().is_some()
{ {
resume_image = Some(new_image.clone()); resume_image = Some(*new_image);
continue; continue;
} }
let op = interactive_shell(InteractiveShellContext { let op = interactive_shell(InteractiveShellContext {
image: Some(new_image.clone()), image: Some(*new_image),
patched: n_versions.get() > 1, patched: n_versions.get() > 1,
}); });
match op { match op {

View File

@ -705,21 +705,13 @@ fn interactive_shell(mut ctx: InteractiveShellContext) -> ShellExitOperation {
} }
} }
"continue" | "c" => { "continue" | "c" => {
if ctx.patched { if let Some(image) = ctx.image.take() {
println!("Error: Continueing execution is not yet supported on patched code."); return ShellExitOperation::ContinueWith(image);
} else { } else {
if let Some(image) = ctx.image.take() { println!("Program state not available, cannot continue execution");
return ShellExitOperation::ContinueWith(image);
} else {
println!("Program state not available, cannot continue execution");
}
} }
} }
"backtrace" | "bt" => { "backtrace" | "bt" => {
if ctx.patched {
println!("Warning: Backtrace on patched code might be inaccurate.");
}
if let Some(ref image) = ctx.image { if let Some(ref image) = ctx.image {
println!("{}", image.execution_state.colored_output()); println!("{}", image.execution_state.colored_output());
} else { } else {