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

RESOLVED FIXED in mozilla9

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Igor Bukanov, Assigned: Igor Bukanov)

Tracking

({perf})

unspecified
mozilla9
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
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.
(Assignee)

Comment 1

6 years ago
Created attachment 561288 [details] [diff] [review]
v1

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)
Comment on attachment 561288 [details] [diff] [review]
v1

Cool.
Attachment #561288 - Flags: review?(wmccloskey) → review+
(Assignee)

Comment 3

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/a84273cf3644
https://hg.mozilla.org/mozilla-central/rev/a84273cf3644
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
You need to log in before you can comment on or make changes to this bug.