Last Comment Bug 684527 - make sure that new GC things are not allocated from finalizers.
: make sure that new GC things are not allocated from finalizers.
Status: RESOLVED FIXED
: perf
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla9
Assigned To: Igor Bukanov
:
Mentors:
Depends on: 681884
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-03 12:16 PDT by Igor Bukanov
Modified: 2011-09-21 02:59 PDT (History)
9 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (8.26 KB, patch)
2011-09-20 13:45 PDT, Igor Bukanov
wmccloskey: review+
Details | Diff | Splinter Review

Description Igor Bukanov 2011-09-03 12:16:19 PDT
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.
Comment 1 Igor Bukanov 2011-09-20 13:45:08 PDT
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.
Comment 2 Bill McCloskey (:billm) 2011-09-20 14:27:27 PDT
Comment on attachment 561288 [details] [diff] [review]
v1

Cool.
Comment 4 Marco Bonardo [::mak] 2011-09-21 02:59:41 PDT
https://hg.mozilla.org/mozilla-central/rev/a84273cf3644

Note You need to log in before you can comment on or make changes to this bug.