Closed Bug 940718 Opened 11 years ago Closed 11 years ago

Mark AutoJSContext as not GCing (and make this true)

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: terrence, Assigned: terrence)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

We still have a few (false positive) hazards over AutoJSContext. I think the best thing to do here is to run a first GetSafeJSContext in nsContentUtils::Init -- where it is safe to GC -- so that we don't have to worry about a potential GC later.

Lets see if this theory works in practice:
https://tbpl.mozilla.org/?tree=Try&rev=20aedee8483e
Bobby, does this sound like a reasonable plan?
Flags: needinfo?(bobbyholley+bmo)
Rather than doing any hacky fixes to the static analysis, I would prefer an explicit separate call to InitSafeJSContext, and have GetSafeJSContext MOZ_ASSERT that mSafeJSContext is non-null.

In a perfect would, InitSafeJSContext would happen during XPConnect startup. But this is what used to happen, and caused a bunch of startup ordering pain (which I fixed in bug 905364). So I think just doing it from nsContentUtils is fine, given that JSContexts are on the way out anyway.
Flags: needinfo?(bobbyholley+bmo)
Great idea, calling it InitSafeJSContext: I'll make that split tomorrow. Try run looks good, modulo existing bustage on tip.
Not bad at all.
Attachment #8335382 - Flags: review?(bobbyholley+bmo)
Attachment #8335382 - Flags: review?(bobbyholley+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/2267eab2fde3
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: