Closed
Bug 1006621
Opened 12 years ago
Closed 1 year ago
SliceBudget::checkOverBudget() doesn't work right for WorkBudget()
Categories
(Core :: JavaScript: GC, defect)
Core
JavaScript: GC
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: mccr8, Unassigned)
Details
I call checkOverBudget() in the outer loop of the cycle collector. The intent is that you are supposed to just do the check right away, no matter how long it has been since the last check. There are only a handful of phases, so paying the price of checking the time is okay. However, checkOverBudget() does this:
bool over = PRMJ_Now() > deadline;
in the case of WorkBudget(), deadline is 0, so this is always true. Thus, I can't use a WorkBudget() to run more than one phase of ICC.
I'm thinking a fix could work something like this:
1. Rename the current checkOverBudget() to checkOverTimeBudget() to indicate that it is only checking the time aspect of the budget, and add a comment that it will always return true for a work budget.
2. Add a new function called something like isOverBudgetEager(). If |deadline| is 0, this returns |counter >= 0|, otherwise it returns |checkOverTimeBudget()|. This would be called by the CC.
This is not a problem for the GC, because it does not call checkOverBudget() directly.
This is only a problem for the CC with the testing functions I'm adding in bug 958353.
Updated•3 years ago
|
Severity: normal → S3
Comment 1•1 year ago
|
||
This seems to have been fixed in the meantime as the deadline is implemented as an offset of the current time:
https://searchfox.org/mozilla-central/rev/b784b4ed27d0fc41a9bbce7d666e1cfcac4778be/js/src/gc/GC.cpp#1798
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•