change off-thread cycle collection to not use a safe JS context

RESOLVED FIXED in mozilla8

Status

()

Core
XPConnect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: luke, Assigned: luke)

Tracking

unspecified
mozilla8
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [inbound])

Attachments

(2 attachments)

(Assignee)

Description

6 years ago
Created attachment 549249 [details] [diff] [review]
patch

When doing cycle-collection off the main thread, XPConnect calls GetSafeJSContext.  This creates a JSContext, associated with the main-thread JSRuntime, that is owned and later destroyed concurrently (when the cycle collection thread is destroyed).  This patch creates a special context to use just for cycle collection that gets destroyed on the main thread during shutdown.  This is enough to satisfy the asserts in bug 650411.  Later, (after we can assume single-threaded XPConnect) we can rip this out.
Attachment #549249 - Flags: review?(peterv)
Attachment #549249 - Flags: review?(mrbkap)
(Assignee)

Updated

6 years ago
Blocks: 650411
(Assignee)

Comment 1

6 years ago
Created attachment 549935 [details] [diff] [review]
rm unused XPCallContext::GetSafeJSContext

Found this dead code while in the area.  Its nice not to have it since it makes it easier to reason about safe JS contexts.
Attachment #549935 - Flags: review?(mrbkap)

Updated

6 years ago
Attachment #549935 - Flags: review?(mrbkap) → review+

Updated

6 years ago
Attachment #549249 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 2

6 years ago
Comment on attachment 549249 [details] [diff] [review]
patch

One review is probably enough; also I think peterv's out.
Attachment #549249 - Flags: review?(peterv)
(Assignee)

Comment 3

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/7046a39cf54d
http://hg.mozilla.org/integration/mozilla-inbound/rev/4f64e4d6b56d
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/7046a39cf54d
http://hg.mozilla.org/mozilla-central/rev/4f64e4d6b56d
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
Comment on attachment 549249 [details] [diff] [review]
patch

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

Fine by me.
Attachment #549249 - Flags: review+
You need to log in before you can comment on or make changes to this bug.