Bug 833340 - Fix a couple of jittests failing with rooting analysis r=terrence

This commit is contained in:
Jon Coppeard 2013-01-22 17:03:05 +00:00
Родитель 2a2992e0f0
Коммит cddac5c60c
4 изменённых файлов: 6 добавлений и 8 удалений

Просмотреть файл

@ -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);