зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1638154: Add is_int24 to shim r=tcampbell
Adding `is_int24` is the only shim change necessary. While I was here, I took the opportunity to align `is_uint24` to more closely match the V8 version (a0d493e27e/src/utils/utils.h (L426-L472)
).
Depends on D76250
Differential Revision: https://phabricator.services.mozilla.com/D76251
This commit is contained in:
Родитель
7929770395
Коммит
d53f7f5018
|
@ -391,7 +391,14 @@ constexpr int kInt64Size = sizeof(int64_t);
|
|||
constexpr int kUC16Size = sizeof(uc16);
|
||||
|
||||
inline constexpr bool IsDecimalDigit(uc32 c) { return c >= '0' && c <= '9'; }
|
||||
inline bool is_uint24(int val) { return (val & 0x00ffffff) == val; }
|
||||
|
||||
inline bool is_uint24(int64_t val) {
|
||||
return !(val >> 24);
|
||||
}
|
||||
inline bool is_int24(int64_t val) {
|
||||
int64_t limit = 1 << 23;
|
||||
return (-limit <= val) && (val < limit);
|
||||
}
|
||||
|
||||
inline bool IsIdentifierStart(uc32 c) {
|
||||
return js::unicode::IsIdentifierStart(uint32_t(c));
|
||||
|
|
Загрузка…
Ссылка в новой задаче