Bug 1320105 : Convert JSID_IS_INT to PropertyKey::isInt() r=jandem

Convert JSID_IS_INT to PropertyKey::isInt()

Differential Revision: https://phabricator.services.mozilla.com/D14011

--HG--
extra : moz-landing-system : lando
This commit is contained in:
inspiro 2018-12-22 14:17:44 +00:00
parent 07d9d64364
commit b8d53fc5d2

View File

@ -53,6 +53,9 @@ struct PropertyKey {
bool operator==(const PropertyKey& rhs) const { return asBits == rhs.asBits; }
bool operator!=(const PropertyKey& rhs) const { return asBits != rhs.asBits; }
MOZ_ALWAYS_INLINE bool isInt() const { return !!(asBits & JSID_TYPE_INT_BIT); }
} JS_HAZ_GC_POINTER;
} // namespace JS
@ -91,6 +94,7 @@ static MOZ_ALWAYS_INLINE bool JSID_IS_INT(jsid id) {
static MOZ_ALWAYS_INLINE int32_t JSID_TO_INT(jsid id) {
MOZ_ASSERT(JSID_IS_INT(id));
MOZ_ASSERT(id.isInt());
uint32_t bits = static_cast<uint32_t>(JSID_BITS(id)) >> 1;
return static_cast<int32_t>(bits);
}