Commit 5e00cb5f authored by titzer's avatar titzer Committed by Commit bot

[wasm] Introduce performance testing options.

Adds --wasm-no-bounds-checks and --wasm-no-stack-checks which
help in diagnosing potential sources of slowdown in WASM code.

R=ahaas@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2511113002
Cr-Commit-Position: refs/heads/master@{#41083}
parent 200cbe92
......@@ -412,6 +412,7 @@ Node* WasmGraphBuilder::Int64Constant(int64_t value) {
void WasmGraphBuilder::StackCheck(wasm::WasmCodePosition position,
Node** effect, Node** control) {
if (FLAG_wasm_no_stack_checks) return;
if (effect == nullptr) {
effect = effect_;
}
......@@ -2895,6 +2896,7 @@ void WasmGraphBuilder::BoundsCheckMem(MachineType memtype, Node* index,
uint32_t offset,
wasm::WasmCodePosition position) {
DCHECK(module_ && module_->instance);
if (FLAG_wasm_no_bounds_checks) return;
uint32_t size = module_->instance->mem_size;
byte memsize = wasm::WasmOpcodes::MemSize(memtype);
......
......@@ -522,6 +522,11 @@ DEFINE_BOOL(wasm_mv_prototype, false,
DEFINE_BOOL(wasm_atomics_prototype, false,
"enable prototype atomic opcodes for wasm")
DEFINE_BOOL(wasm_no_bounds_checks, false,
"disable bounds checks (performance testing only)")
DEFINE_BOOL(wasm_no_stack_checks, false,
"disable stack checks (performance testing only)")
DEFINE_BOOL(wasm_trap_handler, false,
"use signal handlers to catch out of bounds memory access in wasm"
" (currently Linux x86_64 only)")
......
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