Commit b1bf72fd authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Add the wasm-interpret-all flag

If this flag is set, all code will be executed in the interpreter.
At some point in the future we might want to have a variant for testing
all code with this flag. Currently, I am using it for finding
unimplemented functionality in the interpreter and testing existing
functionality.
Mjsunit tests in follow-up CLs will use this flag too.

R=ahaas@chromium.org, titzer@chromium.org
BUG=v8:5822

Change-Id: I1393b4aedbb9f9070e011362ec95cb89f296dab4
Reviewed-on: https://chromium-review.googlesource.com/453700
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43773}
parent 7f460012
......@@ -588,6 +588,8 @@ DEFINE_BOOL(wasm_trap_if, true,
DEFINE_BOOL(wasm_code_fuzzer_gen_test, false,
"Generate a test case when running the wasm-code fuzzer")
DEFINE_BOOL(print_wasm_code, false, "Print WebAssembly code")
DEFINE_BOOL(wasm_interpret_all, false,
"Execute all wasm code in the wasm interpreter")
// Profiler flags.
DEFINE_INT(frame_count, 1, "number of stack frames inspected by the profiler")
......
......@@ -1314,11 +1314,22 @@ class InstantiationHelper {
}
//--------------------------------------------------------------------------
// Set all breakpoints that were set on the shared module.
// Debugging support.
//--------------------------------------------------------------------------
// Set all breakpoints that were set on the shared module.
WasmSharedModuleData::SetBreakpointsOnNewInstance(
compiled_module_->shared(), instance);
if (FLAG_wasm_interpret_all) {
Handle<WasmDebugInfo> debug_info =
WasmInstanceObject::GetOrCreateDebugInfo(instance);
for (int func_index = num_imported_functions,
num_wasm_functions = static_cast<int>(module_->functions.size());
func_index < num_wasm_functions; ++func_index) {
WasmDebugInfo::RedirectToInterpreter(debug_info, func_index);
}
}
//--------------------------------------------------------------------------
// Run the start function if one was specified.
//--------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment