Last Comment Bug 770110 - GC: gcIncrementalState is now used by non-incremental GCs
: GC: gcIncrementalState is now used by non-incremental GCs
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- minor (vote)
: mozilla16
Assigned To: Jon Coppeard (:jonco)
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: 729760
  Show dependency treegraph
Reported: 2012-07-02 03:04 PDT by Jon Coppeard (:jonco)
Modified: 2012-07-04 09:50 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Correct tests of gcIncrementalState (4.43 KB, patch)
2012-07-02 03:14 PDT, Jon Coppeard (:jonco)
wmccloskey: review+
Details | Diff | Splinter Review
Update with review comments and fix assertion issue (4.98 KB, patch)
2012-07-03 04:28 PDT, Jon Coppeard (:jonco)
no flags Details | Diff | Splinter Review

Description Jon Coppeard (:jonco) 2012-07-02 03:04:15 PDT
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.
Comment 1 Jon Coppeard (:jonco) 2012-07-02 03:14:26 PDT
Created attachment 638288 [details] [diff] [review]
Correct tests of gcIncrementalState
Comment 2 [PTO to Dec5] Bill McCloskey (:billm) 2012-07-02 10:31:19 PDT
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.
Comment 3 Jon Coppeard (:jonco) 2012-07-03 04:28:54 PDT
Created attachment 638653 [details] [diff] [review]
Update with review comments and fix assertion issue
Comment 4 Jon Coppeard (:jonco) 2012-07-03 04:32:14 PDT
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).
Comment 6 Ryan VanderMeulen [:RyanVM] 2012-07-04 09:50:41 PDT

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