Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Issue 265793017: Oilpan: move node/element rare data objects to the heap. (Closed)

Created:
6 years, 7 months ago by sof
Modified:
6 years, 7 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, shans, rjwright, alancutter (OOO until 2018), Mike Lawther (Google), webcomponents-bugzilla_chromium.org, rwlbuis, eae+blinkwatch, dglazkov+blink, dstockwell, Timothy Loh, adamk+blink_chromium.org, darktears, Steve Block, dino_apple.com, blink-reviews-html_chromium.org, Eric Willigers
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Oilpan: move node/element rare data objects to the heap. Turn the rare data objects for Node and Elements into garbage collected objects. R=haraken@chromium.org,zerny@chromium.org,erik.corry@gmail.com BUG=357163 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=173615

Patch Set 1 #

Patch Set 2 : Rebased + EventHandler.cpp oilpan compile fix #

Total comments: 12

Patch Set 3 : Rebased + assert for Nodes having no renderer on destruction. #

Total comments: 11

Patch Set 4 : Tidy up rare data creation #

Total comments: 6

Patch Set 5 : Adjust MutationObserverRegistration::create() signature slightly #

Total comments: 18

Patch Set 6 : Rebased #

Patch Set 7 : Implement a weak-like Node reference from a MO registration object #

Total comments: 9

Patch Set 8 : Fix MutationObserverRegistration's weak/strong registration Node reference impl #

Patch Set 9 : Remove explicit dispose() #

Patch Set 10 : Reinstate dispose() for safety #

Total comments: 6

Patch Set 11 : Simplify weak reference handling #

Patch Set 12 : Rebased + have MutationObserver keep a weak ref to registrations #

Total comments: 13

Patch Set 13 : Rebased + add some asserts for registration Node being present. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -79 lines) Patch
M Source/core/animation/ActiveAnimations.h View 1 2 3 4 5 2 chunks +10 lines, -1 line 0 comments Download
M Source/core/animation/ActiveAnimations.cpp View 2 chunks +3 lines, -4 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -4 lines 0 comments Download
M Source/core/dom/ElementRareData.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +9 lines, -15 lines 0 comments Download
M Source/core/dom/ElementRareData.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +8 lines, -1 line 0 comments Download
M Source/core/dom/MutationObserver.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/MutationObserver.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/MutationObserverRegistration.h View 1 2 3 4 5 6 7 8 10 11 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/dom/MutationObserverRegistration.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +14 lines, -8 lines 0 comments Download
M Source/core/dom/Node.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 4 5 6 chunks +24 lines, -19 lines 0 comments Download
M Source/core/dom/NodeRareData.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +14 lines, -7 lines 0 comments Download
M Source/core/dom/NodeRareData.cpp View 1 2 2 chunks +21 lines, -7 lines 0 comments Download
M Source/core/dom/shadow/ElementShadow.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -3 lines 0 comments Download
M Source/core/dom/shadow/ElementShadow.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -3 lines 0 comments Download
M Source/core/dom/shadow/ShadowRoot.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 43 (0 generated)
sof
Please take a look. This moves the "rare data" objects themselves to the heap. The ...
6 years, 7 months ago (2014-05-03 15:03:46 UTC) #1
sof
https://codereview.chromium.org/265793017/diff/20001/Source/core/page/EventHandler.cpp File Source/core/page/EventHandler.cpp (left): https://codereview.chromium.org/265793017/diff/20001/Source/core/page/EventHandler.cpp#oldcode3643 Source/core/page/EventHandler.cpp:3643: RefPtrWillBeRawPtr<TouchList> emptyList = TouchList::create(); The compile fix from https://codereview.chromium.org/264773015/ ...
6 years, 7 months ago (2014-05-03 15:05:34 UTC) #2
haraken
Thanks for working on this! Here is the first round of comments. My first impression ...
6 years, 7 months ago (2014-05-04 01:46:23 UTC) #3
sof
Thanks, great comments - will think about the others some more first. As you have ...
6 years, 7 months ago (2014-05-04 06:33:25 UTC) #4
sof
https://codereview.chromium.org/265793017/diff/20001/Source/core/animation/ActiveAnimations.h File Source/core/animation/ActiveAnimations.h (right): https://codereview.chromium.org/265793017/diff/20001/Source/core/animation/ActiveAnimations.h#newcode101 Source/core/animation/ActiveAnimations.h:101: Member<Element> m_target; On 2014/05/04 01:46:24, haraken wrote: > > ...
6 years, 7 months ago (2014-05-04 18:59:22 UTC) #5
zerny-chromium
It is a bit hard to follow the clearing/non-clearing implied by the two modes, but ...
6 years, 7 months ago (2014-05-05 07:50:17 UTC) #6
sof
https://codereview.chromium.org/265793017/diff/30001/Source/core/dom/MutationObserver.cpp File Source/core/dom/MutationObserver.cpp (right): https://codereview.chromium.org/265793017/diff/30001/Source/core/dom/MutationObserver.cpp#newcode74 Source/core/dom/MutationObserver.cpp:74: ASSERT(m_registrations.isEmpty()); On 2014/05/05 07:50:18, zerny-chromium wrote: > Did this ...
6 years, 7 months ago (2014-05-05 08:48:51 UTC) #7
Erik Corry
https://codereview.chromium.org/265793017/diff/30001/Source/core/animation/ActiveAnimations.h File Source/core/animation/ActiveAnimations.h (right): https://codereview.chromium.org/265793017/diff/30001/Source/core/animation/ActiveAnimations.h#newcode97 Source/core/animation/ActiveAnimations.h:97: // Keep a back reference to the target Element, ...
6 years, 7 months ago (2014-05-05 09:31:26 UTC) #8
sof
https://codereview.chromium.org/265793017/diff/30001/Source/core/dom/MutationObserver.cpp File Source/core/dom/MutationObserver.cpp (right): https://codereview.chromium.org/265793017/diff/30001/Source/core/dom/MutationObserver.cpp#newcode74 Source/core/dom/MutationObserver.cpp:74: ASSERT(m_registrations.isEmpty()); On 2014/05/05 09:31:27, Erik Corry wrote: > On ...
6 years, 7 months ago (2014-05-05 09:40:02 UTC) #9
sof
https://codereview.chromium.org/265793017/diff/30001/Source/core/dom/Node.cpp File Source/core/dom/Node.cpp (right): https://codereview.chromium.org/265793017/diff/30001/Source/core/dom/Node.cpp#newcode333 Source/core/dom/Node.cpp:333: OwnPtrWillBeRawPtr<NodeRareData> data; On 2014/05/05 09:31:27, Erik Corry wrote: > ...
6 years, 7 months ago (2014-05-05 09:41:38 UTC) #10
sof
https://codereview.chromium.org/265793017/diff/30001/Source/core/animation/ActiveAnimations.h File Source/core/animation/ActiveAnimations.h (right): https://codereview.chromium.org/265793017/diff/30001/Source/core/animation/ActiveAnimations.h#newcode97 Source/core/animation/ActiveAnimations.h:97: // Keep a back reference to the target Element, ...
6 years, 7 months ago (2014-05-05 13:38:58 UTC) #11
Erik Corry
LGTM https://codereview.chromium.org/265793017/diff/50001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/50001/Source/core/dom/MutationObserverRegistration.cpp#newcode47 Source/core/dom/MutationObserverRegistration.cpp:47: , m_registrationNode(&registrationNode) This is called in exactly one ...
6 years, 7 months ago (2014-05-05 14:28:45 UTC) #12
sof
https://codereview.chromium.org/265793017/diff/50001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/50001/Source/core/dom/MutationObserverRegistration.cpp#newcode64 Source/core/dom/MutationObserverRegistration.cpp:64: if (m_observer) { On 2014/05/05 14:28:46, Erik Corry wrote: ...
6 years, 7 months ago (2014-05-05 14:57:36 UTC) #13
Erik Corry
https://codereview.chromium.org/265793017/diff/50001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/50001/Source/core/dom/MutationObserverRegistration.cpp#newcode64 Source/core/dom/MutationObserverRegistration.cpp:64: if (m_observer) { On 2014/05/05 14:57:36, sof wrote: > ...
6 years, 7 months ago (2014-05-05 14:58:42 UTC) #14
sof
Thanks for the careful reviewing. (Will wait with this CL until ager's Node hierarchy CL ...
6 years, 7 months ago (2014-05-05 15:36:02 UTC) #15
haraken
It looks like this CL deeply depends on the assumption that the Node hierarchy is ...
6 years, 7 months ago (2014-05-05 16:54:51 UTC) #16
haraken
https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/Node.cpp File Source/core/dom/Node.cpp (right): https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/Node.cpp#newcode348 Source/core/dom/Node.cpp:348: ASSERT(!transientMutationObserverRegistry() || transientMutationObserverRegistry()->isEmpty()); On 2014/05/05 16:54:52, haraken wrote: > ...
6 years, 7 months ago (2014-05-05 16:59:33 UTC) #17
sof
https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.cpp#newcode64 Source/core/dom/MutationObserverRegistration.cpp:64: m_observer->observationEnded(this); On 2014/05/05 16:54:52, haraken wrote: > > After ...
6 years, 7 months ago (2014-05-05 18:00:53 UTC) #18
sof
https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.h File Source/core/dom/MutationObserverRegistration.h (right): https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.h#newcode76 Source/core/dom/MutationObserverRegistration.h:76: RefPtr<Node> m_registrationNodeKeepAlive; On 2014/05/05 16:54:52, haraken wrote: > > ...
6 years, 7 months ago (2014-05-05 19:35:42 UTC) #19
haraken
https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.cpp#newcode64 Source/core/dom/MutationObserverRegistration.cpp:64: m_observer->observationEnded(this); On 2014/05/05 18:00:54, sof wrote: > On 2014/05/05 ...
6 years, 7 months ago (2014-05-06 06:32:23 UTC) #20
sof
https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.cpp#newcode64 Source/core/dom/MutationObserverRegistration.cpp:64: m_observer->observationEnded(this); On 2014/05/06 06:32:23, haraken wrote: > On 2014/05/05 ...
6 years, 7 months ago (2014-05-06 07:13:10 UTC) #21
Erik Corry
https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.h File Source/core/dom/MutationObserverRegistration.h (right): https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.h#newcode75 Source/core/dom/MutationObserverRegistration.h:75: // removed for Oilpan builds. The intended semantics is ...
6 years, 7 months ago (2014-05-06 07:32:08 UTC) #22
Erik Corry
See also http://www.w3.org/TR/dom/#garbage-collection
6 years, 7 months ago (2014-05-06 07:33:22 UTC) #23
haraken
https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/70001/Source/core/dom/MutationObserverRegistration.cpp#newcode64 Source/core/dom/MutationObserverRegistration.cpp:64: m_observer->observationEnded(this); On 2014/05/06 07:13:10, sof wrote: > On 2014/05/06 ...
6 years, 7 months ago (2014-05-06 09:07:24 UTC) #24
sof
Rebased to work with the traced Node hierarchy + weakened the reference that MutationObserverRegistration keeps ...
6 years, 7 months ago (2014-05-06 22:03:24 UTC) #25
haraken
LGTM with a couple of clarifying questions about MutationObserver. I'll let the final decision to ...
6 years, 7 months ago (2014-05-07 02:10:26 UTC) #26
sof
Just realized that the weak-to-strong reference added for MutationObserverRegistration is wrong (it's no different than ...
6 years, 7 months ago (2014-05-07 05:36:20 UTC) #27
sof
Thanks again for the careful reviewing, haraken. The weak'ish Node reference in MutationObserverRegistration should now ...
6 years, 7 months ago (2014-05-07 07:01:01 UTC) #28
haraken
https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp#newcode144 Source/core/dom/MutationObserverRegistration.cpp:144: dispose(); Shouldn't this be: if (!isAlive(m_registrationNode)) { dispose(); m_registrationNode ...
6 years, 7 months ago (2014-05-07 07:10:35 UTC) #29
sof
https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp#newcode144 Source/core/dom/MutationObserverRegistration.cpp:144: dispose(); On 2014/05/07 07:10:36, haraken wrote: > > Shouldn't ...
6 years, 7 months ago (2014-05-07 07:14:55 UTC) #30
Erik Corry
https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp#newcode144 Source/core/dom/MutationObserverRegistration.cpp:144: dispose(); On 2014/05/07 07:10:36, haraken wrote: > > Shouldn't ...
6 years, 7 months ago (2014-05-07 07:18:39 UTC) #31
haraken
https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp#newcode144 Source/core/dom/MutationObserverRegistration.cpp:144: dispose(); On 2014/05/07 07:18:40, Erik Corry wrote: > On ...
6 years, 7 months ago (2014-05-07 07:32:07 UTC) #32
Erik Corry
We don't manually register weak handling callbacks very many places, so I don't think it's ...
6 years, 7 months ago (2014-05-07 07:34:35 UTC) #33
sof
https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp#newcode144 Source/core/dom/MutationObserverRegistration.cpp:144: dispose(); On 2014/05/07 07:32:08, haraken wrote: > On 2014/05/07 ...
6 years, 7 months ago (2014-05-07 07:37:50 UTC) #34
sof
https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp File Source/core/dom/MutationObserverRegistration.cpp (right): https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp#newcode144 Source/core/dom/MutationObserverRegistration.cpp:144: dispose(); On 2014/05/07 07:37:51, sof wrote: > On 2014/05/07 ...
6 years, 7 months ago (2014-05-07 08:13:16 UTC) #35
sof
On 2014/05/07 08:13:16, sof wrote: > https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp > File Source/core/dom/MutationObserverRegistration.cpp (right): > > https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp#newcode144 > ...
6 years, 7 months ago (2014-05-07 10:16:26 UTC) #36
sof
On 2014/05/07 10:16:26, sof wrote: > On 2014/05/07 08:13:16, sof wrote: > > > https://codereview.chromium.org/265793017/diff/170001/Source/core/dom/MutationObserverRegistration.cpp ...
6 years, 7 months ago (2014-05-07 14:05:38 UTC) #37
haraken
Thanks for being persistent. I double-checked and am convinced that the lifetime relationship of this ...
6 years, 7 months ago (2014-05-08 04:13:41 UTC) #38
haraken
forgot to publish comments... https://codereview.chromium.org/265793017/diff/210001/Source/core/dom/ElementRareData.h File Source/core/dom/ElementRareData.h (right): https://codereview.chromium.org/265793017/diff/210001/Source/core/dom/ElementRareData.h#newcode44 Source/core/dom/ElementRareData.h:44: static RawPtr<ElementRareData> create(RenderObject* renderer) RawPtr ...
6 years, 7 months ago (2014-05-08 04:13:58 UTC) #39
sof
https://codereview.chromium.org/265793017/diff/210001/Source/core/dom/ElementRareData.h File Source/core/dom/ElementRareData.h (right): https://codereview.chromium.org/265793017/diff/210001/Source/core/dom/ElementRareData.h#newcode44 Source/core/dom/ElementRareData.h:44: static RawPtr<ElementRareData> create(RenderObject* renderer) On 2014/05/08 04:14:00, haraken wrote: ...
6 years, 7 months ago (2014-05-08 06:43:14 UTC) #40
sof
The CQ bit was checked by sigbjornf@opera.com
6 years, 7 months ago (2014-05-08 06:43:28 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/265793017/220001
6 years, 7 months ago (2014-05-08 06:43:58 UTC) #42
commit-bot: I haz the power
6 years, 7 months ago (2014-05-08 08:09:08 UTC) #43
Message was sent while issue was closed.
Change committed as 173615

Powered by Google App Engine
This is Rietveld 408576698