Closed Bug 751396 Opened 12 years ago Closed 12 years ago

Fire slice callbacks only for "outer" GCs

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: sfink, Assigned: sfink)

References

Details

Attachments

(1 file, 1 obsolete file)

Originally encountered when JSD hit an assertion failure in its slice callback because it saw two BEGINs in a row, because it kicked off another GC from jsdService::~jsdService (called from a JSGC_END callback).

In talking to billm, it seems like the slice callbacks would make the most sense if they only applied to the "outermost" GC.
Attachment #620493 - Flags: review?(wmccloskey)
Comment on attachment 620493 [details] [diff] [review]
Fire slice callbacks only for "outer" GCs

Review of attachment 620493 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/gc/Statistics.cpp
@@ +560,5 @@
> +        if (GCSliceCallback cb = runtime->gcSliceCallback) {
> +            if (last)
> +                (*cb)(runtime, GC_CYCLE_END, GCDescription(!wasFullGC));
> +            else
> +                (*cb)(runtime, GC_SLICE_END, GCDescription(!wasFullGC));

Could you change this to use a ternary operator? I think these cases used to be more different than they are now.

::: js/src/jscntxt.h
@@ +421,5 @@
>      /*
> +     * GCs can't really nest, but a second GC can be triggered from within the
> +     * JSGC_END callback.
> +     */
> +    int                 gcDepth;

Could you put this field in gc/Statistics.h instead?
>::: js/src/jscntxt.h
>@@ +421,5 @@
>>      /*
>> +     * GCs can't really nest, but a second GC can be triggered from within the
>> +     * JSGC_END callback.
>> +     */
>> +    int                 gcDepth;
>
>Could you put this field in gc/Statistics.h instead?

Oh! Somehow I didn't realize that Statistics are already runtime-specific, which is obvious in retrospect.
Attachment #620511 - Flags: review?(wmccloskey)
Attachment #620493 - Attachment is obsolete: true
Attachment #620493 - Flags: review?(wmccloskey)
Blocks: 751398
Attachment #620511 - Flags: review?(wmccloskey) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/6d53129e8414
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/6d53129e8414
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: