Skip to content

Commit

Permalink
[Cleanup] Remove DCHECK messages
Browse files Browse the repository at this point in the history
This CL replaces all DCHECK messages in chrome_unwind_table_android.cc
with comments to reduce binary size.

Change-Id: I8264ee130b04da75186e9d7bace2d95931a0c9cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3140490
Reviewed-by: Mike Wittman <wittman@chromium.org>
Commit-Queue: Charlie Hu <chenleihu@google.com>
Cr-Commit-Position: refs/heads/main@{#917783}
  • Loading branch information
Charlie Hu authored and Chromium LUCI CQ committed Sep 2, 2021
1 parent ba0b0ce commit 25cce7d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions base/profiler/chrome_unwind_table_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ uintptr_t DecodeULEB128(const uint8_t*& bytes) {
uintptr_t value = 0;
unsigned shift = 0;
do {
DCHECK_LE(shift, sizeof(uintptr_t) * 8) << "ULEB128 must not overflow.";
DCHECK_LE(shift, sizeof(uintptr_t) * 8); // ULEB128 must not overflow.
value += (*bytes & 0x7f) << shift;
shift += 7;
} while (*bytes++ & 0x80);
Expand Down Expand Up @@ -92,12 +92,11 @@ UnwindInstructionResult ExecuteUnwindInstruction(
// 1001nnnn (nnnn != 13,15)
// Set vsp = r[nnnn].
const uint8_t register_index = *instruction++ & 0b00001111;
DCHECK_NE(register_index, 13) << "Must not set sp to sp.";
DCHECK_NE(register_index, 15) << "Must not set sp to pc.";
DCHECK_NE(register_index, 13); // Must not set sp to sp.
DCHECK_NE(register_index, 15); // Must not set sp to pc.
// Note: We shouldn't have cases that are setting caller-saved registers
// using this instruction.
DCHECK_GE(register_index, 4)
<< "Must not set sp to caller-saved registers.";
DCHECK_GE(register_index, 4);

RegisterContextStackPointer(thread_context) =
*GetRegisterPointer(thread_context, register_index);
Expand Down

0 comments on commit 25cce7d

Please sign in to comment.