Merge tracemonkey to mozilla-central.

This commit is contained in:
Robert Sayre 2010-08-09 06:40:52 -07:00
commit 304cbeb993
3 changed files with 15 additions and 8 deletions

View File

@ -896,13 +896,12 @@ JS_SuspendRequest(JSContext *cx)
if (saveDepth == 0)
return 0;
JS_THREAD_DATA(cx)->conservativeGC.enable();
do {
cx->outstandingRequests++; /* compensate for StopRequest */
StopRequest(cx);
} while (cx->requestDepth);
JS_THREAD_DATA(cx)->conservativeGC.enable();
return saveDepth;
#else
return 0;
@ -916,13 +915,12 @@ JS_ResumeRequest(JSContext *cx, jsrefcount saveDepth)
if (saveDepth == 0)
return;
JS_THREAD_DATA(cx)->conservativeGC.disable();
JS_ASSERT(cx->outstandingRequests != 0);
do {
JS_BeginRequest(cx);
cx->outstandingRequests--; /* compensate for JS_BeginRequest */
} while (--saveDepth != 0);
JS_THREAD_DATA(cx)->conservativeGC.disable();
#endif
}

View File

@ -2462,6 +2462,7 @@ js_TraceRuntime(JSTracer *trc)
#ifdef JS_THREADSAFE
JS_ASSERT(acx->outstandingRequests != 0);
#endif
JS_ASSERT(JS_THREAD_DATA(acx)->conservativeGC.isEnabled());
void *thing;
switch (gcr->tag) {
default:
@ -2496,8 +2497,16 @@ js_TraceRuntime(JSTracer *trc)
if (!IsMarkedGCThing(thing)) {
ConservativeGCTest test = IsGCThingWord(rt, reinterpret_cast<jsuword>(thing));
fprintf(stderr,
"Conservative GC scanner has missed the root %p with tag %ld"
" on the stack due to %d. Aborting.\n", thing, (long) gcr->tag, int(test));
"Conservative GC scanner has missed the root 0x%p with tag %ld"
" on the stack due to %d. The root location 0x%p, distance from"
" the stack base %ld, conservative gc span %ld."
" Consevtaive GC status for the thread %d."
" Aborting.\n",
thing, (long) gcr->tag, int(test), (void *) gcr,
(long) ((jsword) JS_THREAD_DATA(acx)->nativeStackBase - (jsword) gcr),
(long) ((jsword) JS_THREAD_DATA(acx)->nativeStackBase -
(jsword) JS_THREAD_DATA(acx)->conservativeGC.nativeStackTop),
JS_THREAD_DATA(acx)->conservativeGC.enableCount);
JS_ASSERT(false);
abort();
}

View File

@ -150,7 +150,7 @@ JS_STATIC_ASSERT(sizeof(JSValueTag) == sizeof(uint32));
JS_ENUM_HEADER(JSValueShiftedTag, uint64)
{
JSVAL_SHIFTED_TAG_MAX_DOUBLE = (((uint64)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT),
JSVAL_SHIFTED_TAG_MAX_DOUBLE = ((((uint64)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF),
JSVAL_SHIFTED_TAG_INT32 = (((uint64)JSVAL_TAG_INT32) << JSVAL_TAG_SHIFT),
JSVAL_SHIFTED_TAG_UNDEFINED = (((uint64)JSVAL_TAG_UNDEFINED) << JSVAL_TAG_SHIFT),
JSVAL_SHIFTED_TAG_STRING = (((uint64)JSVAL_TAG_STRING) << JSVAL_TAG_SHIFT),
@ -207,7 +207,7 @@ typedef uint32 JSValueTag;
#define JSVAL_TAG_OBJECT (uint32)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT)
typedef uint64 JSValueShiftedTag;
#define JSVAL_SHIFTED_TAG_MAX_DOUBLE (((uint64)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT)
#define JSVAL_SHIFTED_TAG_MAX_DOUBLE ((((uint64)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF)
#define JSVAL_SHIFTED_TAG_INT32 (((uint64)JSVAL_TAG_INT32) << JSVAL_TAG_SHIFT)
#define JSVAL_SHIFTED_TAG_UNDEFINED (((uint64)JSVAL_TAG_UNDEFINED) << JSVAL_TAG_SHIFT)
#define JSVAL_SHIFTED_TAG_STRING (((uint64)JSVAL_TAG_STRING) << JSVAL_TAG_SHIFT)