Fix clang debug build.
BUG= R=rafaelw@chromium.org Review URL: https://codereview.chromium.org/64243003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
0990f44f00
commit
233b8b4f96
@ -6310,6 +6310,29 @@ static inline uintptr_t AsciiRangeMask(uintptr_t w, char m, char n) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
static bool CheckFastAsciiConvert(char* dst,
|
||||||
|
char* src,
|
||||||
|
int length,
|
||||||
|
bool changed,
|
||||||
|
bool is_to_lower) {
|
||||||
|
bool expected_changed = false;
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
if (dst[i] == src[i]) continue;
|
||||||
|
expected_changed = true;
|
||||||
|
if (is_to_lower) {
|
||||||
|
ASSERT('A' <= src[i] && src[i] <= 'Z');
|
||||||
|
ASSERT(dst[i] == src[i] + ('a' - 'A'));
|
||||||
|
} else {
|
||||||
|
ASSERT('a' <= src[i] && src[i] <= 'z');
|
||||||
|
ASSERT(dst[i] == src[i] - ('a' - 'A'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (expected_changed == changed);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
template<class Converter>
|
template<class Converter>
|
||||||
static bool FastAsciiConvert(char* dst,
|
static bool FastAsciiConvert(char* dst,
|
||||||
char* src,
|
char* src,
|
||||||
@ -6381,28 +6404,6 @@ static bool FastAsciiConvert(char* dst,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
static bool CheckFastAsciiConvert(char* dst,
|
|
||||||
char* src,
|
|
||||||
int length,
|
|
||||||
bool changed,
|
|
||||||
bool is_to_lower) {
|
|
||||||
bool expected_changed = false;
|
|
||||||
for (int i = 0; i < length; i++) {
|
|
||||||
if (dst[i] == src[i]) continue;
|
|
||||||
expected_changed = true;
|
|
||||||
if (is_to_lower) {
|
|
||||||
ASSERT('A' <= src[i] && src[i] <= 'Z');
|
|
||||||
ASSERT(dst[i] == src[i] + ('a' - 'A'));
|
|
||||||
} else {
|
|
||||||
ASSERT('a' <= src[i] && src[i] <= 'z');
|
|
||||||
ASSERT(dst[i] == src[i] - ('a' - 'A'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (expected_changed == changed);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user