Closed
Bug 1474272
Opened 6 years ago
Closed 6 years ago
Stop using js::GetGlobalForObjectCrossCompartment in xpc::NativeGlobal
Categories
(Core :: XPConnect, enhancement, P2)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(4 files, 2 obsolete files)
1.78 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
8.03 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
837 bytes,
patch
|
jonco
:
review+
|
Details | Diff | Splinter Review |
6.46 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
This is sort of a big one with 51 callers, although most of them are easy to audit. Also, NativeGlobal currently always gets the object's global even though most callers already pass in a global. It would be nice to make NativeGlobal assert JS_IsGlobalObject and then have a separate function for the non-global object case.
Updated•6 years ago
|
Priority: -- → P2
Assignee | ||
Comment 1•6 years ago
|
||
Attachment #8994801 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 2•6 years ago
|
||
Just some minor clean up that makes it easier to reason about some of the NativeGlobal calls.
Attachment #8994814 -
Flags: review?(bzbarsky)
Comment 3•6 years ago
|
||
Comment on attachment 8994801 [details] [diff] [review] Part 1 - Remove unused WrappedJSToDictionary Looks like this was used by some FxOS code at one point... r=me
Attachment #8994801 -
Flags: review?(bzbarsky) → review+
Comment 4•6 years ago
|
||
Comment on attachment 8994814 [details] [diff] [review] Part 2 - Use more precise types in Promise code and add some assertions r=me
Attachment #8994814 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 5•6 years ago
|
||
With the later patches we can call this function in the memory reporting code while iterating the heap. We're replacing some js::GetGlobalForObjectCrossCompartment calls and that one doesn't assert anything about the heap state.
Attachment #8995149 -
Flags: review?(jcoppeard)
Assignee | ||
Comment 6•6 years ago
|
||
I could also remove the assertion if you think that's fine..
Assignee | ||
Comment 7•6 years ago
|
||
xpc::NativeGlobal is now faster because it doesn't have to look up the object's global. xpc::NonCCWObjectNativeGlobal is nice to be explicit about not having a CCW object. This is green on top of the patches in the dependent bugs.
Attachment #8995154 -
Flags: review?(bzbarsky)
Comment 8•6 years ago
|
||
Comment on attachment 8995149 [details] [diff] [review] Part 3 - Call AssertHeapIsIdleOrIterating instead of AssertHeapIsIdle in JS::GetNonCCWObjectGlobal Review of attachment 8995149 [details] [diff] [review]: ----------------------------------------------------------------- This is fine like this.
Attachment #8995149 -
Flags: review?(jcoppeard) → review+
Assignee | ||
Comment 9•6 years ago
|
||
Attachment #8995154 -
Attachment is obsolete: true
Attachment #8995154 -
Flags: review?(bzbarsky)
Attachment #8995155 -
Flags: review?(bzbarsky)
Comment 10•6 years ago
|
||
Comment on attachment 8995155 [details] [diff] [review] Part 4 - Make NativeGlobal only work with global objects and add NonCCWObjectNativeGlobal for other callers I'd like bholley to take a look. I will admit to not being a fan of the length of NonCCWObjectNativeGlobal.
Attachment #8995155 -
Flags: review?(bzbarsky) → review?(bobbyholley)
Assignee | ||
Comment 11•6 years ago
|
||
After our discussion yesterday, I think Bobby will like this one more.
Attachment #8995155 -
Attachment is obsolete: true
Attachment #8995155 -
Flags: review?(bobbyholley)
Attachment #8995457 -
Flags: review?(bobbyholley)
Updated•6 years ago
|
Attachment #8995457 -
Flags: review?(bobbyholley) → review+
Comment 12•6 years ago
|
||
Pushed by jandemooij@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/6d6402132e9f part 1 - Remove unused WrappedJSToDictionary. r=bz https://hg.mozilla.org/integration/mozilla-inbound/rev/8d9247183eb7 part 2 - Use more precise types in Promise code and add some assertions. r=bz https://hg.mozilla.org/integration/mozilla-inbound/rev/53e8a6239f8e part 3 - Call AssertHeapIsIdleOrIterating instead of AssertHeapIsIdle in JS::GetNonCCWObjectGlobal. r=jonco https://hg.mozilla.org/integration/mozilla-inbound/rev/f486f734d4c4 part 4 - Stop using js::GetGlobalForObjectCrossCompartment in xpc::NativeGlobal. r=bholley
Comment 13•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6d6402132e9f https://hg.mozilla.org/mozilla-central/rev/8d9247183eb7 https://hg.mozilla.org/mozilla-central/rev/53e8a6239f8e https://hg.mozilla.org/mozilla-central/rev/f486f734d4c4
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•