WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
143942
Merge TreeShared into Node.
https://bugs.webkit.org/show_bug.cgi?id=143942
Summary
Merge TreeShared into Node.
Andreas Kling
Reported
2015-04-19 22:39:09 PDT
Node is the only remaining subclass of TreeShared. Let's just fold TreeShared into Node.
Attachments
Patch
(13.36 KB, patch)
2015-04-19 22:49 PDT
,
Andreas Kling
darin
: review+
Details
Formatted Diff
Diff
Patch for landing
(13.49 KB, patch)
2015-04-20 01:23 PDT
,
Andreas Kling
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Andreas Kling
Comment 1
2015-04-19 22:49:57 PDT
Created
attachment 251143
[details]
Patch
Darin Adler
Comment 2
2015-04-19 23:19:39 PDT
Comment on
attachment 251143
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=251143&action=review
> Source/WebCore/dom/Node.h:545 > + void ref() > + { > + ASSERT(isMainThread()); > + ASSERT(!m_deletionHasBegun); > + ASSERT(!m_inRemovedLastRefFunction); > + ASSERT(!m_adoptionIsRequired); > + ++m_refCount; > + }
These function bodies are kind of big. I’d rather see them at the end of the file, outside the class definition. Some day we have a chance of being able to read the class definition.
> Source/WebCore/dom/Node.h:560 > + void deref() > + { > + ASSERT(isMainThread()); > + ASSERT(m_refCount >= 0); > + ASSERT(!m_deletionHasBegun); > + ASSERT(!m_inRemovedLastRefFunction); > + ASSERT(!m_adoptionIsRequired); > + if (--m_refCount <= 0 && !parentNode()) { > +#ifndef NDEBUG > + m_inRemovedLastRefFunction = true; > +#endif > + removedLastRef(); > + } > + }
This one too.
> Source/WebCore/dom/Node.h:567 > + bool hasOneRef() const > + { > + ASSERT(!m_deletionHasBegun); > + ASSERT(!m_inRemovedLastRefFunction); > + return m_refCount == 1; > + }
Maybe even this one.
> Source/WebCore/dom/Node.h:572 > + int refCount() const > + { > + return m_refCount; > + }
Not sure about this one. Not sure why we even have it!
> Source/WebCore/dom/Node.h:578 > +#ifndef NDEBUG > + bool m_deletionHasBegun { false }; > + bool m_inRemovedLastRefFunction { false }; > + bool m_adoptionIsRequired { true }; > +#endif
Lame that these are public, but I guess that’s how we do it.
> Source/WebCore/dom/Node.h:721 > + int m_refCount;
How did you decide whether to put this before or after m_nodeFlags?
Andreas Kling
Comment 3
2015-04-20 01:22:44 PDT
(In reply to
comment #2
)
> Comment on
attachment 251143
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=251143&action=review
> > > Source/WebCore/dom/Node.h:545 > > + void ref() > > + { > > + ASSERT(isMainThread()); > > + ASSERT(!m_deletionHasBegun); > > + ASSERT(!m_inRemovedLastRefFunction); > > + ASSERT(!m_adoptionIsRequired); > > + ++m_refCount; > > + } > > These function bodies are kind of big. I’d rather see them at the end of the > file, outside the class definition. Some day we have a chance of being able > to read the class definition.
Sure thing, I'll pop them all out.
> > Source/WebCore/dom/Node.h:721 > > + int m_refCount; > > How did you decide whether to put this before or after m_nodeFlags?
I didn't think enough about this. I'll move it to before so the object layout matches what we had before the change.
Andreas Kling
Comment 4
2015-04-20 01:23:47 PDT
Created
attachment 251153
[details]
Patch for landing
WebKit Commit Bot
Comment 5
2015-04-20 02:19:32 PDT
Comment on
attachment 251153
[details]
Patch for landing Clearing flags on attachment: 251153 Committed
r183009
: <
http://trac.webkit.org/changeset/183009
>
WebKit Commit Bot
Comment 6
2015-04-20 02:19:36 PDT
All reviewed patches have been landed. Closing bug.
Chris Dumez
Comment 7
2015-04-21 12:03:04 PDT
May have caused a 3.6% regression on DoYouEvenBench:
https://perf.webkit.org/#mode=charts&chartList=%5B%5B%22mac-yosemite%22%2C%22DoYouEvenBench%2FFull%3ATime%3ATotal%22%5D%5D
https://perf.webkit.org/#mode=charts&chartList=%5B%5B%22mac-mavericks%22%2C%22DoYouEvenBench%2FFull%3ATime%3ATotal%22%5D%5D
Darin Adler
Comment 8
2015-04-21 15:11:49 PDT
Really!? I wonder what happened.
Andreas Kling
Comment 9
2015-04-21 15:19:28 PDT
(In reply to
comment #8
)
> Really!? I wonder what happened.
I'll try to reproduce locally, but if there's indeed a problem, my guess would be failure to inline Node::ref() or Node::deref().
Andreas Kling
Comment 10
2015-04-23 02:08:36 PDT
The bug was that DOM nodes were no longer getting WTF_MAKE_FAST_ALLOCATED :| Fixed in <
https://trac.webkit.org/r183183
>
Darin Adler
Comment 11
2015-04-23 08:01:36 PDT
Wow, how did we miss that!? Did we also forget to make Node noncopyable, or was that handled some other way?
Chris Dumez
Comment 12
2015-04-23 09:33:49 PDT
(In reply to
comment #10
)
> The bug was that DOM nodes were no longer getting WTF_MAKE_FAST_ALLOCATED :| > > Fixed in <
https://trac.webkit.org/r183183
>
oh boy I'm glad the bots caught this :)
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug