Commit 8060c267 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] Remove negation in --wasm-no-[bounds-checks|stack-checks]

The flag naming was confusing, and inconsistent with other flags. To
disable bounds checks, you now have to say --no-wasm-bounds-checks
instead of the original --wasm-no-bounds-checks. Similarly, it is now
--no-wasm-stack-checks instead of --wasm-no-stack-checks.

R=clemensb@chromium.org

Bug: v8:10021
Change-Id: Ib57963866af794d4e47d68e520a42b4054ed2a8f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2017475
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66003}
parent 272f9182
...@@ -317,7 +317,7 @@ Node* WasmGraphBuilder::IntPtrConstant(intptr_t value) { ...@@ -317,7 +317,7 @@ Node* WasmGraphBuilder::IntPtrConstant(intptr_t value) {
void WasmGraphBuilder::StackCheck(wasm::WasmCodePosition position) { void WasmGraphBuilder::StackCheck(wasm::WasmCodePosition position) {
DCHECK_NOT_NULL(env_); // Wrappers don't get stack checks. DCHECK_NOT_NULL(env_); // Wrappers don't get stack checks.
if (FLAG_wasm_no_stack_checks || !env_->runtime_exception_support) { if (!FLAG_wasm_stack_checks || !env_->runtime_exception_support) {
return; return;
} }
...@@ -3557,7 +3557,7 @@ Node* WasmGraphBuilder::BoundsCheckMem(uint8_t access_size, Node* index, ...@@ -3557,7 +3557,7 @@ Node* WasmGraphBuilder::BoundsCheckMem(uint8_t access_size, Node* index,
EnforceBoundsCheck enforce_check) { EnforceBoundsCheck enforce_check) {
DCHECK_LE(1, access_size); DCHECK_LE(1, access_size);
index = Uint32ToUintptr(index); index = Uint32ToUintptr(index);
if (FLAG_wasm_no_bounds_checks) return index; if (!FLAG_wasm_bounds_checks) return index;
if (use_trap_handler() && enforce_check == kCanOmitBoundsCheck) { if (use_trap_handler() && enforce_check == kCanOmitBoundsCheck) {
return index; return index;
......
...@@ -742,10 +742,11 @@ FOREACH_WASM_STAGING_FEATURE_FLAG(WASM_STAGING_IMPLICATION) ...@@ -742,10 +742,11 @@ FOREACH_WASM_STAGING_FEATURE_FLAG(WASM_STAGING_IMPLICATION)
#undef WASM_STAGING_IMPLICATION #undef WASM_STAGING_IMPLICATION
DEFINE_BOOL(wasm_opt, false, "enable wasm optimization") DEFINE_BOOL(wasm_opt, false, "enable wasm optimization")
DEFINE_BOOL(wasm_no_bounds_checks, false, DEFINE_BOOL(
"disable bounds checks (performance testing only)") wasm_bounds_checks, true,
DEFINE_BOOL(wasm_no_stack_checks, false, "enable bounds checks (disable for performance testing only)")
"disable stack checks (performance testing only)") DEFINE_BOOL(wasm_stack_checks, true,
"enable stack checks (disable for performance testing only)")
DEFINE_BOOL(wasm_math_intrinsics, true, DEFINE_BOOL(wasm_math_intrinsics, true,
"intrinsify some Math imports into wasm") "intrinsify some Math imports into wasm")
......
...@@ -471,7 +471,7 @@ class LiftoffCompiler { ...@@ -471,7 +471,7 @@ class LiftoffCompiler {
} }
void StackCheck(WasmCodePosition position) { void StackCheck(WasmCodePosition position) {
if (FLAG_wasm_no_stack_checks || !env_->runtime_exception_support) return; if (!FLAG_wasm_stack_checks || !env_->runtime_exception_support) return;
out_of_line_code_.push_back( out_of_line_code_.push_back(
OutOfLineCode::StackCheck(position, __ cache_state()->used_registers, OutOfLineCode::StackCheck(position, __ cache_state()->used_registers,
RegisterDebugSideTableEntry())); RegisterDebugSideTableEntry()));
...@@ -1703,7 +1703,7 @@ class LiftoffCompiler { ...@@ -1703,7 +1703,7 @@ class LiftoffCompiler {
Label* AddOutOfLineTrap(WasmCodePosition position, Label* AddOutOfLineTrap(WasmCodePosition position,
WasmCode::RuntimeStubId stub, uint32_t pc = 0) { WasmCode::RuntimeStubId stub, uint32_t pc = 0) {
DCHECK(!FLAG_wasm_no_bounds_checks); DCHECK(FLAG_wasm_bounds_checks);
// The pc is needed for memory OOB trap with trap handler enabled. Other // The pc is needed for memory OOB trap with trap handler enabled. Other
// callers should not even compute it. // callers should not even compute it.
DCHECK_EQ(pc != 0, stub == WasmCode::kThrowWasmTrapMemOutOfBounds && DCHECK_EQ(pc != 0, stub == WasmCode::kThrowWasmTrapMemOutOfBounds &&
...@@ -1725,7 +1725,7 @@ class LiftoffCompiler { ...@@ -1725,7 +1725,7 @@ class LiftoffCompiler {
!base::IsInBounds(offset, access_size, env_->max_memory_size); !base::IsInBounds(offset, access_size, env_->max_memory_size);
if (!force_check && !statically_oob && if (!force_check && !statically_oob &&
(FLAG_wasm_no_bounds_checks || env_->use_trap_handler)) { (!FLAG_wasm_bounds_checks || env_->use_trap_handler)) {
return false; return false;
} }
......
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