Closed Bug 660783 Opened 13 years ago Closed 13 years ago

dom workers should not assert about non-main thread during GC marking

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

For parallel marking from bug 638660 we need to make sure that all JSClass::trace hooks can be called from multiple threads and tolerate parallel execution for the same object.

Yet the hook implementation in dpm/src/treads insists that the calling thread is the main thread. AFAICS the assert can be removed as the GC graph traversal in dom/src/threads is stateless.
Attached patch v1Splinter Review
The patch removes the assert under the assumption that nsDOMWorkerMessageHandler::Trace is stateless.
Assignee: general → igor
Attachment #536271 - Flags: review?(bent.mozilla)
Ben: nsDOMWorker::Trace only mark its collection if the worker is not cancelled. As this mayleaves a live object with finalized GC things reachable via collections, it require care when accessing those. So why not to call nsDOMWorkerMessageHandler::Trace there unconditionally?
(In reply to comment #2)
> Ben: nsDOMWorker::Trace only mark its collection if the worker is not
> cancelled. As this mayleaves a live object with finalized GC things
> reachable via collections, it require care when accessing those. So why not
> to call nsDOMWorkerMessageHandler::Trace there unconditionally?

I'm not sure... It might have been to prevent some type of cyclical leak in the past (all of these objects are very cyclical). In any case it's safe to have finalized gcthings in the collection as long as the canceled flag is set since we will never attempt to use them once canceled.

All of this code has changed in bug 649537 (and Trace is threadsafe there) so I'd rather not change anything here but remove the assertion.
Attachment #536271 - Flags: review?(bent.mozilla) → review+
http://hg.mozilla.org/tracemonkey/rev/a4a11ea5646c
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/a4a11ea5646c
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: