Commit 5ae5ee8f authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm][respect] Avoid 'sanity check'

Replace by "consistency check", or "validity check", or more specific
wording as appropriate.

R=ecmziegler@chromium.org

Bug: v8:10619
Change-Id: Ifd7852d8f703d5b784d53671b82d65db15722ede
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2253855Reviewed-by: 's avatarEmanuel Ziegler <ecmziegler@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68440}
parent 891e1b63
...@@ -462,7 +462,7 @@ void LiftoffAssembler::CacheState::InitMerge(const CacheState& source, ...@@ -462,7 +462,7 @@ void LiftoffAssembler::CacheState::InitMerge(const CacheState& source,
// they do not move). Try to keep register in registers, but avoid duplicates. // they do not move). Try to keep register in registers, but avoid duplicates.
InitMergeRegion(this, source_begin, target_begin, num_locals, kKeepStackSlots, InitMergeRegion(this, source_begin, target_begin, num_locals, kKeepStackSlots,
kConstantsNotAllowed, kNoReuseRegisters, used_regs); kConstantsNotAllowed, kNoReuseRegisters, used_regs);
// Sanity check: All the {used_regs} are really in use now. // Consistency check: All the {used_regs} are really in use now.
DCHECK_EQ(used_regs, used_registers & used_regs); DCHECK_EQ(used_regs, used_registers & used_regs);
// Last, initialize the section in between. Here, constants are allowed, but // Last, initialize the section in between. Here, constants are allowed, but
......
...@@ -2165,7 +2165,7 @@ AsmJsOffsetsResult DecodeAsmJsOffsets(Vector<const uint8_t> encoded_offsets) { ...@@ -2165,7 +2165,7 @@ AsmJsOffsetsResult DecodeAsmJsOffsets(Vector<const uint8_t> encoded_offsets) {
Decoder decoder(encoded_offsets); Decoder decoder(encoded_offsets);
uint32_t functions_count = decoder.consume_u32v("functions count"); uint32_t functions_count = decoder.consume_u32v("functions count");
// Sanity check. // Consistency check.
DCHECK_GE(encoded_offsets.size(), functions_count); DCHECK_GE(encoded_offsets.size(), functions_count);
functions.reserve(functions_count); functions.reserve(functions_count);
......
...@@ -83,7 +83,7 @@ base::AddressRegion DisjointAllocationPool::Merge( ...@@ -83,7 +83,7 @@ base::AddressRegion DisjointAllocationPool::Merge(
auto below = above; auto below = above;
--below; --below;
// Sanity check: // Consistency check:
DCHECK(above == regions_.end() || below->end() < above->begin()); DCHECK(above == regions_.end() || below->end() < above->begin());
// Adjacent to {below}: merge and done. // Adjacent to {below}: merge and done.
......
...@@ -22,7 +22,7 @@ REG_DEFS = { ...@@ -22,7 +22,7 @@ REG_DEFS = {
def EnsurePortIsAvailable(addr=SOCKET_ADDR): def EnsurePortIsAvailable(addr=SOCKET_ADDR):
# As a sanity check, check that the TCP port is available by binding to it # As a validity check, check that the TCP port is available by binding to it
# ourselves (and then unbinding). Otherwise, we could end up talking to an # ourselves (and then unbinding). Otherwise, we could end up talking to an
# old instance of the GDB stub that is still hanging around, or to some # old instance of the GDB stub that is still hanging around, or to some
# unrelated service that uses the same port number. Of course, there is still # unrelated service that uses the same port number. Of course, there is still
......
...@@ -283,7 +283,7 @@ let id = (() => { // identity exported function ...@@ -283,7 +283,7 @@ let id = (() => { // identity exported function
print("Verifying bounds for size = " + size); print("Verifying bounds for size = " + size);
assertEquals(size, table.length); assertEquals(size, table.length);
for (let i = 0; i < 5; i++) { for (let i = 0; i < 5; i++) {
// Sanity check for indirect call // Validity check for indirect call
assertEquals(10, instances[i].exports.main(0)); assertEquals(10, instances[i].exports.main(0));
// Bounds check at different out of bounds indices // Bounds check at different out of bounds indices
assertInvalidFunction = function(s) { assertInvalidFunction = function(s) {
......
...@@ -51,7 +51,7 @@ function checkImportsAndExports(imported_module_name, imported_function_name, ...@@ -51,7 +51,7 @@ function checkImportsAndExports(imported_module_name, imported_function_name,
.addBody([kExprCallFunction, 0]) .addBody([kExprCallFunction, 0])
.exportAs(exported_function_name); .exportAs(exported_function_name);
// sanity check: does javascript agree with out shouldThrow annotation? // Consistency check: does javascript agree with our shouldThrow annotation?
assertEquals(shouldThrow, assertEquals(shouldThrow,
!isValidUtf8(imported_module_name) || !isValidUtf8(imported_module_name) ||
!isValidUtf8(imported_function_name) || !isValidUtf8(imported_function_name) ||
......
...@@ -19,7 +19,7 @@ function checkImport( ...@@ -19,7 +19,7 @@ function checkImport(
assertEquals(imp(4), instance.exports.call_imp(4)); assertEquals(imp(4), instance.exports.call_imp(4));
} }
checkImport('mod', 'foo'); // sanity check checkImport('mod', 'foo'); // Base check.
checkImport('mod', '☺☺happy☺☺'); checkImport('mod', '☺☺happy☺☺');
checkImport('☺☺happy☺☺', 'foo'); checkImport('☺☺happy☺☺', 'foo');
checkImport('☺☺happy☺☺', '☼+☃=☹'); checkImport('☺☺happy☺☺', '☼+☃=☹');
...@@ -42,7 +42,7 @@ function checkExports( ...@@ -42,7 +42,7 @@ function checkExports(
assertEquals(-6, instance.exports[exported_name_mul](-3, 2)); assertEquals(-6, instance.exports[exported_name_mul](-3, 2));
} }
checkExports('mul', 'mul', 'add', 'add'); // sanity check checkExports('mul', 'mul', 'add', 'add'); // Base check.
checkExports('☺☺mul☺☺', 'mul', '☺☺add☺☺', 'add'); checkExports('☺☺mul☺☺', 'mul', '☺☺add☺☺', 'add');
checkExports('☺☺mul☺☺', '☺☺mul☺☺', '☺☺add☺☺', '☺☺add☺☺'); checkExports('☺☺mul☺☺', '☺☺mul☺☺', '☺☺add☺☺', '☺☺add☺☺');
......
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