Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: src/wasm/wasm-module.cc

Issue 2526783002: [base] Define CHECK comparison for signed vs. unsigned (Closed)
Patch Set: Rebase & refactor for windows Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 0ddd2abe33a5362e8a0766889f115a860e9bebc2..b92914f7dcf59c3e12b064e0ffca84c078a6135a 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -52,8 +52,8 @@ MaybeHandle<String> ExtractStringFromModuleBytes(
uint32_t offset, uint32_t size) {
// TODO(wasm): cache strings from modules if it's a performance win.
Handle<SeqOneByteString> module_bytes = compiled_module->module_bytes();
- DCHECK_GE(static_cast<size_t>(module_bytes->length()), offset);
- DCHECK_GE(static_cast<size_t>(module_bytes->length() - offset), size);
+ DCHECK_GE(module_bytes->length(), offset);
+ DCHECK_GE(module_bytes->length() - offset, size);
Address raw = module_bytes->GetCharsAddress() + offset;
if (!unibrow::Utf8::Validate(reinterpret_cast<const byte*>(raw), size))
return {}; // UTF8 decoding error for name.
@@ -110,7 +110,7 @@ void* TryAllocateBackingStore(Isolate* isolate, size_t size,
// addressable memory after the guard page can be made inaccessible.
const size_t alloc_size =
RoundUp(kWasmMaxHeapOffset, base::OS::CommitPageSize());
- DCHECK_EQ(0u, size % base::OS::CommitPageSize());
+ DCHECK_EQ(0, size % base::OS::CommitPageSize());
// AllocateGuarded makes the whole region inaccessible by default.
void* memory = base::OS::AllocateGuarded(alloc_size);
@@ -888,7 +888,7 @@ MaybeHandle<WasmCompiledModule> WasmModule::CompileFunctions(
// TODO(wasm): only save the sections necessary to deserialize a
// {WasmModule}. E.g. function bodies could be omitted.
size_t module_bytes_len = module_end - module_start;
- DCHECK_LE(module_bytes_len, static_cast<size_t>(kMaxInt));
+ DCHECK_LE(module_bytes_len, kMaxInt);
Vector<const uint8_t> module_bytes_vec(module_start,
static_cast<int>(module_bytes_len));
Handle<String> module_bytes_string =
@@ -2014,7 +2014,7 @@ MaybeHandle<WasmModuleObject> wasm::CreateModuleObjectFromBytes(
compiled_module->set_script(asm_js_script);
size_t offset_tables_len =
asm_js_offset_tables_end - asm_js_offset_tables_start;
- DCHECK_GE(static_cast<size_t>(kMaxInt), offset_tables_len);
+ DCHECK_GE(kMaxInt, offset_tables_len);
Handle<ByteArray> offset_tables =
isolate->factory()->NewByteArray(static_cast<int>(offset_tables_len));
memcpy(offset_tables->GetDataStartAddress(), asm_js_offset_tables_start,
« src/base/logging.h ('K') | « src/wasm/wasm-module.h ('k') | src/wasm/wasm-objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698