Closed Bug 1548613 Opened 7 months ago Closed 7 months ago

Get rid of window's FastGetGlobalJSObject thing

Categories

(Core :: DOM: Core & HTML, task)

task
Not set

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

It's under-documented, footfunny (can return gray objects), and shouldn't be needed if we mark GetGlobaJSObject(PreserveColor) final on inner and outer windows.

Marking GetGlobalJSObject and GetGlobalJSObjectPreserveColor final and inline
on inner/outer windows allows compilers to de-virtualize and inline them, which
makes them just as fast as calling FastGetGlobalJSObject is now (in the case of
GetGlobalJSObjectPreserveColor; GetGlobalJSObject has to do the gray-unmarking,
which is a bit more work).

In WindowDestroyedEvent::Run we want to switch to GetGlobalJSObject(), because
we want to root the object and hence should unmark gray.

In nsGlobalWindowInner::RunTimeoutHandler we likewise want to unmark gray. The
AutoEntryScript constructor likely did that already, but it's not that
expensive when it doesn't need to do any work.

Blocks: 1548625
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1622d158818f
Get rid of FastGetGlobalJSObject.  r=mccr8,jonco
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.