Closed Bug 770110 Opened 11 years ago Closed 11 years ago

GC: gcIncrementalState is now used by non-incremental GCs

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: jonco, Assigned: jonco)

References

Details

(Whiteboard: [js:t])

Attachments

(1 file, 1 obsolete file)

It used to be the case that JSRuntime::gcIncrementalState == NO_INCREMENTAL implied a non-incremental GC was taking place.

Following the fix for bug 763984, gcIncrementalState is used even when doing a non-incremental GC, so this is no longer true.

A couple of places where this test is made should be updated.

This doesn't affect the final behaviour of the GC, but does mean that for non-incremental GCs JIT code is discarded twice and ValidateIncrementalMarking is called unnecessarily.
Assignee: general → jcoppeard
Attachment #638288 - Flags: review?(wmccloskey)
Comment on attachment 638288 [details] [diff] [review]
Correct tests of gcIncrementalState

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

This basically looks good.

::: js/src/jsgc.cpp
@@ +3582,5 @@
>  #endif
>  
> +    bool isIncremental = budget != SliceBudget::Unlimited ||
> +        zeal == ZealIncrementalRootsThenFinish ||
> +        zeal == ZealIncrementalMarkAllThenFinish;

I don't think this is quite right. If we're in the last slice of an incremental GC, the budget can be set to Unlimited. Maybe you want to add a condition || rt->gcIncrementalState != NO_INCREMENTAL.

Also, the second and third lines should be indented so that zeal lines up with budget.
Attachment #638288 - Flags: review?(wmccloskey) → review+
Whiteboard: [js:t]
The original patch cased assertion failures on the try build - JS_ROOT_MARKING_ASSERT was going off because roots can be marked when gcIncrementalState == NO_INCREMENTAL, when called either from ValidateIncrementalMarking or TraceRuntime.  The updated patch should fix this (currently trying again).
https://hg.mozilla.org/mozilla-central/rev/df79a01137c1
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.