Skip to content

Commit

Permalink
#438: revert M1371908 for startup assertions and crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
classilla committed Dec 16, 2017
1 parent 96e1bd0 commit 956fd74
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 37 deletions.
6 changes: 0 additions & 6 deletions js/src/jit-test/tests/gc/bug-1371908.js

This file was deleted.

21 changes: 0 additions & 21 deletions js/src/jit-test/tests/gc/bug1146213.js

This file was deleted.

6 changes: 1 addition & 5 deletions js/src/jsgc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6845,11 +6845,7 @@ gc::MergeCompartments(JSCompartment* source, JSCompartment* target)

JSRuntime* rt = source->runtimeFromMainThread();

MOZ_ASSERT(!source->zone()->wasGCStarted());
MOZ_ASSERT(!target->zone()->wasGCStarted());
JS::AutoAssertOnGC nogc(rt);

AutoTraceSession session(rt);
AutoPrepareForTracing prepare(rt, SkipAtoms);

// Cleanup tables and other state in the source compartment that will be
// meaningless after merging into the target compartment.
Expand Down
9 changes: 4 additions & 5 deletions js/src/vm/HelperThreads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,13 +1103,12 @@ GlobalHelperThreadState::mergeParseTaskCompartment(JSRuntime* rt, ParseTask* par
Handle<GlobalObject*> global,
JSCompartment* dest)
{
// Finish any ongoing incremental GC that may affect the destination zone.
if (JS::IsIncrementalGCInProgress(rt) && dest->zone()->wasGCStarted())
JS::FinishIncrementalGC(rt, JS::gcreason::API);

// After we call LeaveParseTaskZone() it's not safe to GC until we have
// finished merging the contents of the parse task's compartment into the
// destination compartment.
// destination compartment. Finish any ongoing incremental GC first and
// assert that no allocation can occur. (Bug 1371908 changes this, but
// generates assertion failures.)
gc::AutoFinishGC finishGC(rt);
JS::AutoAssertNoAlloc noAlloc(rt);

LeaveParseTaskZone(rt, parseTask);
Expand Down

0 comments on commit 956fd74

Please sign in to comment.