Closed Bug 639235 Opened 9 years ago Closed 9 years ago

mark watch points after the main GC phase

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: gal, Assigned: gal)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

This patch adds an iterative weak pointer marking phase after the main GC is done. We will soon add another types of weak roots int there, so the infrastructure is a good addition anyway. This makes our object mark path a little slimmer.
Attached patch patchSplinter Review
Assignee: general → gal
Attachment #517204 - Flags: review?(brendan)
Comment on attachment 517204 [details] [diff] [review]
patch

while (true) { if (!foo()) break; ... } is just while (foo()) { ... }, but if you are trying to future-proof, how will adding more if (!foo2()) break; statements scale? Won't you need to break on any false return, but only after calling all?

Jason should be in on this for the watchpoint overhaul he's doing.

/be
Attachment #517204 - Flags: review?(brendan) → review?(jorendorff)
Comment on attachment 517204 [details] [diff] [review]
patch

This doesn't pose any problems for the watchpoint rewrite.

It's scary, because the worst-case performance is O(n^2)... in the GC mark phase, which seems bad. I sure don't know a better way to implement WeakMap, though, and what's good enough for WeakMap is surely good enough for the watchpoint table.

r=me, no nits.
Attachment #517204 - Flags: review?(jorendorff) → review+
http://hg.mozilla.org/tracemonkey/rev/97fb5391ed75
Whiteboard: fixed-in-tracemonkey
Blocks: 639729
Depends on: 642209
http://hg.mozilla.org/mozilla-central/rev/97fb5391ed75
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.