зеркало из https://github.com/mozilla/gecko-dev.git
Bug 833340 - Fix a couple of jittests failing with rooting analysis r=terrence
This commit is contained in:
Родитель
2a2992e0f0
Коммит
cddac5c60c
|
@ -1054,7 +1054,7 @@ JSObject::preventExtensions(JSContext *cx)
|
|||
* new dense elements can be added without calling growElements(), which
|
||||
* checks isExtensible().
|
||||
*/
|
||||
if (isNative() && !JSObject::sparsifyDenseElements(cx, self))
|
||||
if (self->isNative() && !JSObject::sparsifyDenseElements(cx, self))
|
||||
return false;
|
||||
|
||||
return self->setFlag(cx, BaseShape::NOT_EXTENSIBLE, GENERATE_SHAPE);
|
||||
|
|
|
@ -157,10 +157,10 @@ JSString::readBarrier(JSString *str)
|
|||
}
|
||||
|
||||
JS_ALWAYS_INLINE bool
|
||||
JSString::validateLength(JSContext *cx, size_t length)
|
||||
JSString::validateLength(JSContext *maybecx, size_t length)
|
||||
{
|
||||
if (JS_UNLIKELY(length > JSString::MAX_LENGTH)) {
|
||||
js_ReportAllocationOverflow(cx);
|
||||
js_ReportAllocationOverflow(maybecx);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -314,11 +314,9 @@ ConcatStringsMaybeAllowGC(JSContext *cx,
|
|||
return left;
|
||||
|
||||
size_t wholeLength = leftLen + rightLen;
|
||||
if (!JSString::validateLength(cx, wholeLength)) {
|
||||
if (!allowGC)
|
||||
cx->clearPendingException();
|
||||
JSContext *cxIfCanGC = allowGC ? cx : NULL;
|
||||
if (!JSString::validateLength(cxIfCanGC, wholeLength))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (JSShortString::lengthFits(wholeLength)) {
|
||||
JSShortString *str = allowGC ? js_NewGCShortString(cx) : js_TryNewGCShortString(cx);
|
||||
|
|
|
@ -239,7 +239,7 @@ class JSString : public js::gc::Cell
|
|||
* representable by a JSString. An allocation overflow is reported if false
|
||||
* is returned.
|
||||
*/
|
||||
static inline bool validateLength(JSContext *cx, size_t length);
|
||||
static inline bool validateLength(JSContext *maybecx, size_t length);
|
||||
|
||||
static void staticAsserts() {
|
||||
JS_STATIC_ASSERT(JS_BITS_PER_WORD >= 32);
|
||||
|
|
Загрузка…
Ссылка в новой задаче