Closed Bug 1009118 Opened 6 years ago Closed 6 years ago

Add isUnlimited method to SliceBudget

Categories

(Core :: JavaScript: GC, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file)

I also am doing a little bit of cleanup around initialization.
The assertion is slightly silly, except that in the initial version of
this patch I was checking both counter and deadline, but the counter
gets reset in checkOverBudget, even with an unlimited budget, so things
were going haywire in certain situations.  I can remove it if you'd like.

try run on top of a patch that actually uses this in the CC:
  https://tbpl.mozilla.org/?tree=Try&rev=6aa15826b120
Attachment #8421800 - Flags: review?(jcoppeard)
(No huge rush on reviewing this, I'm probably not going to land this for a few days to let the telemetry settle down for a previous CC patch.)
Comment on attachment 8421800 [details] [diff] [review]
Add isUnlimited to SliceBudget.

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

::: js/src/jsgc.cpp
@@ +1945,5 @@
>  }
>  
>  SliceBudget::SliceBudget()
> +  : deadline(unlimitedDeadline),
> +    counter(unlimitedStartCounter)

You could just call reset() in the body of the constructor.

@@ +1970,5 @@
>      bool over = PRMJ_Now() > deadline;
>      if (!over)
>          counter = CounterReset;
> +    MOZ_ASSERT(wasUnlimited == isUnlimited(),
> +               "checkOverBudget should not affect whether the budget is unlimited");

I think this is simple enough that the assertion is unnecessary :)
Attachment #8421800 - Flags: review?(jcoppeard) → review+
https://hg.mozilla.org/mozilla-central/rev/bebd8650a712
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.