Closed Bug 817614 Opened 13 years ago Closed 13 years ago

GC: Fix minor issue with GC zeal mode and add tests

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(1 file)

I started writing some tests to check that GC state changes as it should. This showed up the problem that one of the zeal modes was yielding before entering the sweep phase, and this taking more than its supposed two slices. This is not a big issue,
the main idea is to start added tests for this stuff.
QA Contact: jcoppeard
Assignee: general → jcoppeard
QA Contact: jcoppeard
The issue is with mode 8, which is meant to mark the roots in the first slice and then finish collecting in the second. Instead, it adds and extra marking slice between the two.
I had to change GCDebugSlice to use DEBUG_GC reason, otherwise it's not possible to use the zeal modes from the shell like this.
Attachment #687806 - Flags: review?(wmccloskey)
Comment on attachment 687806 [details] [diff] [review] Add test functions and fix zeal issue Review of attachment 687806 [details] [diff] [review]: ----------------------------------------------------------------- Thanks. I like the idea of testing that GC zeal actually works. ::: js/src/builtin/TestingFunctions.cpp @@ +462,5 @@ > + gc::State globalState = cx->runtime->gcIncrementalState; > + if (globalState == gc::NO_INCREMENTAL) > + state = 0; > + else if (globalState == gc::MARK) > + state = 1; Can you use strings here instead of numbers? You can generate the strings like so: *vp = js_NewStringCopyZ(cx, "mark"); ::: js/src/jsgc.cpp @@ +3797,5 @@ > > if (zeal == ZealIncrementalRootsThenFinish || zeal == ZealIncrementalMarkAllThenFinish) { > /* > * Yields between slices occurs at predetermined points in these > + * modes, the budget is not used. This should be a semicolon instead of a comma because it's an independent clause.
Attachment #687806 - Flags: review?(wmccloskey) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: