Index: src/scanner-character-streams.cc |
diff --git a/src/scanner-character-streams.cc b/src/scanner-character-streams.cc |
index 5b30026befb061c5ea6a10d9babbdf3a38b3bb47..9ec0ad1008316dfca01264c619d9b5c88655a231 100644 |
--- a/src/scanner-character-streams.cc |
+++ b/src/scanner-character-streams.cc |
@@ -55,8 +55,8 @@ void BufferedUtf16CharacterStream::SlowPushBack(uc16 character) { |
buffer_cursor_ = buffer_end_; |
} |
// Ensure that there is room for at least one pushback. |
- ASSERT(buffer_cursor_ > buffer_); |
- ASSERT(pos_ > 0); |
+ DCHECK(buffer_cursor_ > buffer_); |
+ DCHECK(pos_ > 0); |
buffer_[--buffer_cursor_ - buffer_] = character; |
if (buffer_cursor_ == buffer_) { |
pushback_limit_ = NULL; |
@@ -102,7 +102,7 @@ GenericStringUtf16CharacterStream::GenericStringUtf16CharacterStream( |
unsigned end_position) |
: string_(data), |
length_(end_position) { |
- ASSERT(end_position >= start_position); |
+ DCHECK(end_position >= start_position); |
pos_ = start_position; |
} |
@@ -208,12 +208,12 @@ static bool IsUtf8MultiCharacterFollower(byte later_byte) { |
static inline void Utf8CharacterBack(const byte* buffer, unsigned* cursor) { |
byte character = buffer[--*cursor]; |
if (character > unibrow::Utf8::kMaxOneByteChar) { |
- ASSERT(IsUtf8MultiCharacterFollower(character)); |
+ DCHECK(IsUtf8MultiCharacterFollower(character)); |
// Last byte of a multi-byte character encoding. Step backwards until |
// pointing to the first byte of the encoding, recognized by having the |
// top two bits set. |
while (IsUtf8MultiCharacterFollower(buffer[--*cursor])) { } |
- ASSERT(IsUtf8MultiCharacterStart(buffer[*cursor])); |
+ DCHECK(IsUtf8MultiCharacterStart(buffer[*cursor])); |
} |
} |
@@ -229,7 +229,7 @@ static inline void Utf8CharacterForward(const byte* buffer, unsigned* cursor) { |
// 110..... - (0xCx, 0xDx) one additional byte (minimum). |
// 1110.... - (0xEx) two additional bytes. |
// 11110... - (0xFx) three additional bytes (maximum). |
- ASSERT(IsUtf8MultiCharacterStart(character)); |
+ DCHECK(IsUtf8MultiCharacterStart(character)); |
// Additional bytes is: |
// 1 if value in range 0xC0 .. 0xDF. |
// 2 if value in range 0xE0 .. 0xEF. |
@@ -238,7 +238,7 @@ static inline void Utf8CharacterForward(const byte* buffer, unsigned* cursor) { |
unsigned additional_bytes = |
((0x3211u) >> (((character - 0xC0) >> 2) & 0xC)) & 0x03; |
*cursor += additional_bytes; |
- ASSERT(!IsUtf8MultiCharacterFollower(buffer[1 + additional_bytes])); |
+ DCHECK(!IsUtf8MultiCharacterFollower(buffer[1 + additional_bytes])); |
} |
} |
@@ -254,12 +254,12 @@ void Utf8ToUtf16CharacterStream::SetRawPosition(unsigned target_position) { |
int old_pos = raw_data_pos_; |
Utf8CharacterBack(raw_data_, &raw_data_pos_); |
raw_character_position_--; |
- ASSERT(old_pos - raw_data_pos_ <= 4); |
+ DCHECK(old_pos - raw_data_pos_ <= 4); |
// Step back over both code units for surrogate pairs. |
if (old_pos - raw_data_pos_ == 4) raw_character_position_--; |
} while (raw_character_position_ > target_position); |
// No surrogate pair splitting. |
- ASSERT(raw_character_position_ == target_position); |
+ DCHECK(raw_character_position_ == target_position); |
return; |
} |
// Spool forwards in the utf8 buffer. |
@@ -268,11 +268,11 @@ void Utf8ToUtf16CharacterStream::SetRawPosition(unsigned target_position) { |
int old_pos = raw_data_pos_; |
Utf8CharacterForward(raw_data_, &raw_data_pos_); |
raw_character_position_++; |
- ASSERT(raw_data_pos_ - old_pos <= 4); |
+ DCHECK(raw_data_pos_ - old_pos <= 4); |
if (raw_data_pos_ - old_pos == 4) raw_character_position_++; |
} |
// No surrogate pair splitting. |
- ASSERT(raw_character_position_ == target_position); |
+ DCHECK(raw_character_position_ == target_position); |
} |