Bug 519363 - topcrash [@ js_Interpret], change some code to aid in debugging efforts. r=brendan
This commit is contained in:
@@ -314,9 +314,9 @@ ResizeSlots(JSContext *cx, JSObject *obj, uint32 oldlen, uint32 newlen)
|
||||
jsval *slots, *newslots;
|
||||
|
||||
if (newlen == 0) {
|
||||
if (obj->dslots) {
|
||||
if (DSLOTS_IS_NOT_NULL(obj)) {
|
||||
cx->free(obj->dslots - 1);
|
||||
obj->dslots = NULL;
|
||||
obj->dslots = DSLOTS_NULL_RESIZE_SLOTS;
|
||||
}
|
||||
return JS_TRUE;
|
||||
}
|
||||
@@ -326,7 +326,7 @@ ResizeSlots(JSContext *cx, JSObject *obj, uint32 oldlen, uint32 newlen)
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
slots = obj->dslots ? obj->dslots - 1 : NULL;
|
||||
slots = DSLOTS_IS_NOT_NULL(obj) ? obj->dslots - 1 : NULL;
|
||||
newslots = (jsval *) cx->realloc(slots, (size_t(newlen) + 1) * sizeof(jsval));
|
||||
if (!newslots)
|
||||
return JS_FALSE;
|
||||
@@ -1195,9 +1195,9 @@ slowarray_enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
|
||||
static void
|
||||
array_finalize(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
if (obj->dslots)
|
||||
if (DSLOTS_IS_NOT_NULL(obj))
|
||||
cx->free(obj->dslots - 1);
|
||||
obj->dslots = NULL;
|
||||
obj->dslots = DSLOTS_NULL_ARRAY_FINALIZE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1811,7 +1811,7 @@ array_reverse(JSContext *cx, uintN argc, jsval *vp)
|
||||
|
||||
if (OBJ_IS_DENSE_ARRAY(cx, obj) && !js_PrototypeHasIndexedProperties(cx, obj)) {
|
||||
/* An empty array or an array with no elements is already reversed. */
|
||||
if (len == 0 || !obj->dslots)
|
||||
if (len == 0 || !DSLOTS_IS_NOT_NULL(obj))
|
||||
return JS_TRUE;
|
||||
|
||||
/*
|
||||
@@ -2538,7 +2538,7 @@ array_shift(JSContext *cx, uintN argc, jsval *vp)
|
||||
|
||||
if (OBJ_IS_DENSE_ARRAY(cx, obj) && !js_PrototypeHasIndexedProperties(cx, obj) &&
|
||||
length < js_DenseArrayCapacity(obj)) {
|
||||
if (JS_LIKELY(obj->dslots != NULL)) {
|
||||
if (JS_LIKELY(DSLOTS_IS_NOT_NULL(obj))) {
|
||||
*vp = obj->dslots[0];
|
||||
if (*vp == JSVAL_HOLE)
|
||||
*vp = JSVAL_VOID;
|
||||
@@ -3405,7 +3405,7 @@ js_NewEmptyArray(JSContext* cx, JSObject* proto)
|
||||
obj->fslots[JSSLOT_ARRAY_COUNT] = 0;
|
||||
for (unsigned i = JSSLOT_ARRAY_COUNT + 1; i != JS_INITIAL_NSLOTS; ++i)
|
||||
obj->fslots[i] = JSVAL_VOID;
|
||||
obj->dslots = NULL;
|
||||
obj->dslots = DSLOTS_NULL_NEW_EMPTY_ARRAY;
|
||||
return obj;
|
||||
}
|
||||
#ifdef JS_TRACER
|
||||
|
||||
Reference in New Issue
Block a user