Closed Bug 684527 Opened 9 years ago Closed 9 years ago

make sure that new GC things are not allocated from finalizers.

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: igor, Assigned: igor)

References

Details

(Keywords: perf)

Attachments

(1 file)

This is a followup for the bug 681884 comment 6. ArenaLists::refillFreeList, http://hg.mozilla.org/mozilla-central/file/a351ae35f2c4/js/src/jsgc.cpp#l1439 , contains:

    /*
     * For compatibility with older code we tolerate calling the allocator
     * during the GC in optimized builds.
     */
    JSRuntime *rt = cx->runtime;
    JS_ASSERT(!rt->gcRunning);
    if (rt->gcRunning)
        return NULL;


As that check is done each time we refil the free list it does not come for free. We should remove that and fix the broken callers that tries to allocate during the GC from finalizers or the GC callback.
Attached patch v1Splinter Review
The patch removes rt->gcRunning check from  ArenaLists::refillFreeList. It was not necessary to make the try server green. 

Besides that check the patch also passes JSCompartment *, not JSContext *, to various helper methods that refillFreeList calls. It emphasis that error reporting is only done in refil and makes my other patches smaller.
Assignee: general → igor
Attachment #561288 - Flags: review?(wmccloskey)
https://hg.mozilla.org/mozilla-central/rev/a84273cf3644
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
You need to log in before you can comment on or make changes to this bug.