Bug 779073 - Don't treat GC verifier as an incremental GC (r=terrence)

This commit is contained in:
Bill McCloskey 2012-09-25 17:04:17 -07:00
parent 6663628f6b
commit 01cbc0f8ee
4 changed files with 13 additions and 4 deletions

View File

@ -1549,7 +1549,7 @@ JS_TransplantObject(JSContext *cx, JSObject *origobjArg, JSObject *targetArg)
* for that GC. Hence, we finish any ongoing incremental GC before the
* transplant to avoid leaks.
*/
if (cx->runtime->gcIncrementalState != NO_INCREMENTAL) {
if (IsIncrementalGCInProgress(cx->runtime)) {
PrepareForIncrementalGC(cx->runtime);
FinishIncrementalGC(cx->runtime, gcreason::TRANSPLANT);
}

View File

@ -127,7 +127,7 @@ js::PrepareForFullGC(JSRuntime *rt)
JS_FRIEND_API(void)
js::PrepareForIncrementalGC(JSRuntime *rt)
{
if (rt->gcIncrementalState == gc::NO_INCREMENTAL)
if (!IsIncrementalGCInProgress(rt))
return;
for (CompartmentsIter c(rt); !c.done(); c.next()) {
@ -795,7 +795,7 @@ NotifyDidPaint(JSRuntime *rt)
return;
}
if (rt->gcIncrementalState != gc::NO_INCREMENTAL && !rt->gcInterFrameGC) {
if (IsIncrementalGCInProgress(rt) && !rt->gcInterFrameGC) {
PrepareForIncrementalGC(rt);
GCSlice(rt, GC_NORMAL, gcreason::REFRESH_FRAME);
}
@ -809,6 +809,12 @@ IsIncrementalGCEnabled(JSRuntime *rt)
return rt->gcIncrementalEnabled && rt->gcMode == JSGC_MODE_INCREMENTAL;
}
JS_FRIEND_API(bool)
IsIncrementalGCInProgress(JSRuntime *rt)
{
return (rt->gcIncrementalState != gc::NO_INCREMENTAL && !rt->gcVerifyPreData);
}
extern JS_FRIEND_API(void)
DisableIncrementalGC(JSRuntime *rt)
{

View File

@ -809,6 +809,9 @@ NotifyDidPaint(JSRuntime *rt);
extern JS_FRIEND_API(bool)
IsIncrementalGCEnabled(JSRuntime *rt);
JS_FRIEND_API(bool)
IsIncrementalGCInProgress(JSRuntime *rt);
extern JS_FRIEND_API(void)
DisableIncrementalGC(JSRuntime *rt);

View File

@ -1339,7 +1339,7 @@ js::SaveScriptFilename(JSContext *cx, const char *filename)
* scripts or exceptions pointing to the filename may no longer be
* reachable.
*/
if (rt->gcIncrementalState != NO_INCREMENTAL && rt->gcIsFull)
if (IsIncrementalGCInProgress(rt) && rt->gcIsFull)
sfe->marked = true;
#endif