Closed Bug 1377490 Opened 8 years ago Closed 8 years ago

Make nsWindow final to allow the compiler to devirtualize some calls

Categories

(Core :: Widget: Win32, enhancement)

All
Windows
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Performance Impact ?
Tracking Status
firefox56 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

My first attempt didn't quite work out: https://hg.mozilla.org/try/rev/635d506cdeb8aff7f21d8a7c93dfc23c889b2d02 It seems like it should be an idempotent change, but apparently not: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ed958cccbc7f110e2fbb49c79f2b09d7b8d4b20d I'll try adding a bool:1 on nsWindow to indicate the special "ChidlWindow" behavior for WindowStyle() instead...
This should be an idempotent change. I think we could get rid of the mIsChildWindow flag if the 'mWindowType' values used for nsWindow vs ChildWindow are disjoint, but I'll leave that for a follow-up bug (if you think it's possible). There were a few M(c3) failures, but after a few more runs it looks like they were just noise. https://treeherder.mozilla.org/#/jobs?repo=try&revision=bc1d738fd463c618db9d542a9676e70a329a45be
Attachment #8882718 - Flags: review?(jmathies)
Comment on attachment 8882718 [details] [diff] [review] Make nsWindow 'final' to possibly devirtualize some calls Review of attachment 8882718 [details] [diff] [review]: ----------------------------------------------------------------- ::: widget/windows/nsWindow.h @@ +77,5 @@ > typedef mozilla::widget::MSGResult MSGResult; > typedef mozilla::widget::IMEContext IMEContext; > > public: > + nsWindow(bool aIsChildWindow = false); You should probably add "explicit" here. I don't think we want a bool to be able to implicitly convertible to a nsWindow. We should have been checking this on Linux and probably also macOS builds, but that check may not be available with MSVC.
(In reply to Xidorn Quan [:xidorn] UTC+10 from comment #2) > You should probably add "explicit" here. I don't think we want a bool to be > able to implicitly convertible to a nsWindow. Heh, yeah, I forgot. Thanks, I'll add it. > We should have been checking this on Linux and probably also macOS builds, > but that check may not be available with MSVC. I'm doing similar changes for gtk in bug 1377486 and cocoa in bug 1377591.
Attachment #8882718 - Flags: review?(jmathies) → review+
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/8b0cc21a82b3 Make nsWindow 'final' to possibly devirtualize some calls. r=jimm
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Performance Impact: --- → ?
Whiteboard: [qf]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: