GC: gcIncrementalState is now used by non-incremental GCs

RESOLVED FIXED in mozilla16

Status

()

Core
JavaScript Engine
--
minor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jonco, Assigned: jonco)

Tracking

Trunk
mozilla16
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [js:t])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
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)

Updated

5 years ago
Assignee: general → jcoppeard
(Assignee)

Comment 1

5 years ago
Created attachment 638288 [details] [diff] [review]
Correct tests of gcIncrementalState
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]
(Assignee)

Comment 3

5 years ago
Created attachment 638653 [details] [diff] [review]
Update with review comments and fix assertion issue
Attachment #638288 - Attachment is obsolete: true
(Assignee)

Comment 4

5 years ago
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).
Blocks: 729760
(Assignee)

Comment 5

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