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 273843003: [Oilpan]: Make StylePropertySet fully garbage collected. (Closed)

Created:
6 years, 7 months ago by wibling-chromium
Modified:
6 years, 6 months ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-css, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, dglazkov+blink, dstockwell, eae+blinkwatch, ed+blinkwatch_opera.com, Eric Willigers, Mike Lawther (Google), rjwright, rwlbuis, rune+blink, shans, sof, Steve Block, Timothy Loh
Visibility:
Public.

Description

[Oilpan]: Make StylePropertySet fully garbage collected. This also required moving ElementData and subclasses to the oilpan heap to avoid a RefPtr -> Persistent -> Member cycle. This change makes use of the ephemeron (weak hashmap with fix point) support to remove elements in the MatchedPropertiesCache during a GC. This is done by specializing the HashTrait for the value in the hash map since it is the one with the embedded WeakMember. The specialized HashTrait's traceInCollection method is called iteratively during GC tracing to mark the entries that are live in the map. It is also called during GC weak processing where it must report back whether a specific element is alive or dead. If dead it is removed from the map. One caveat is if the map is being traced strongly in which case the weak members are traced as normal members. This can happen if there is an iterator to the map on the stack. I have also changed back to the add/assign pattern for putting entries into hash maps to avoid the extra lookup I added. This should be safe since we will have a pointer to the hash map's backing on the stack if a GC occur so the backing and its entries should be marked strongly, meaning it should be moved. R=ager@chromium.org, erik.corry@gmail.com, haraken@chromium.org, oilpan-reviews@chromium.org, tkent@chromium.org, vegorov@chromium.org, zerny@chromium.org BUG=341815 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177012

Patch Set 1 #

Patch Set 2 : #

Total comments: 27

Patch Set 3 : Review feedback #

Patch Set 4 : Fix mac build #

Total comments: 12

Patch Set 5 : Integrate with ephemeron support for removing entries in hashmap under gc #

Patch Set 6 : add comment for ShareableElementData new #

Total comments: 17

Patch Set 7 : review feedback #

Patch Set 8 : forgot some feedback #

Total comments: 4

Patch Set 9 : More feedback #

Patch Set 10 : Fix crash found by svg/custom/invisible-text-after-scrolling.xhtml #

Total comments: 19

Patch Set 11 : rebase and review feedback #

Patch Set 12 : fix non-oilpan build #

Patch Set 13 : review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+292 lines, -108 lines) Patch
M Source/core/animation/interpolation/LengthStyleInterpolationTest.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSCalculationValueTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSKeyframeRule.h View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/css/CSSKeyframeRule.cpp View 2 chunks +6 lines, -2 lines 0 comments Download
M Source/core/css/StylePropertySet.h View 1 2 3 4 5 chunks +14 lines, -9 lines 0 comments Download
M Source/core/css/StylePropertySet.cpp View 1 2 3 4 5 chunks +7 lines, -7 lines 0 comments Download
M Source/core/css/StyleRule.h View 5 chunks +15 lines, -15 lines 0 comments Download
M Source/core/css/StyleRule.cpp View 5 chunks +37 lines, -7 lines 0 comments Download
M Source/core/css/parser/BisonCSSParser.h View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/css/parser/BisonCSSParser-in.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -4 lines 0 comments Download
M Source/core/css/parser/SizesCalcParserTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/resolver/MatchResult.h View 1 2 3 4 5 6 7 3 chunks +14 lines, -2 lines 0 comments Download
M Source/core/css/resolver/MatchResult.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/css/resolver/MatchedPropertiesCache.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +24 lines, -5 lines 0 comments Download
M Source/core/css/resolver/MatchedPropertiesCache.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +40 lines, -1 line 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 3 4 3 chunks +3 lines, -2 lines 0 comments Download
M Source/core/dom/CSSSelectorWatch.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 10 4 chunks +4 lines, -4 lines 0 comments Download
M Source/core/dom/ElementData.h View 1 2 3 4 5 6 7 8 8 chunks +36 lines, -8 lines 0 comments Download
M Source/core/dom/ElementData.cpp View 1 2 3 4 7 chunks +48 lines, -11 lines 0 comments Download
M Source/core/dom/ElementDataCache.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M Source/core/dom/ElementDataCache.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/PresentationAttributeStyle.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/dom/PresentationAttributeStyle.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +11 lines, -9 lines 0 comments Download
M Source/core/editing/EditingStyle.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLTableElement.cpp View 1 2 3 4 3 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 40 (0 generated)
wibling-chromium
6 years, 7 months ago (2014-05-08 08:59:54 UTC) #1
haraken
+tasak, +esprehn I'm not sure if the handling of MatcheProperties is correct. https://codereview.chromium.org/273843003/diff/20001/Source/core/css/StylePropertySet.h File Source/core/css/StylePropertySet.h ...
6 years, 7 months ago (2014-05-08 11:43:44 UTC) #2
zerny-chromium
It would be wonderful to localize the weak processing of the matched properties cache, but ...
6 years, 7 months ago (2014-05-08 12:22:26 UTC) #3
wibling-chromium
Thanks for the review! Replies inline below. https://codereview.chromium.org/273843003/diff/20001/Source/core/css/StylePropertySet.h File Source/core/css/StylePropertySet.h (right): https://codereview.chromium.org/273843003/diff/20001/Source/core/css/StylePropertySet.h#newcode44 Source/core/css/StylePropertySet.h:44: class StylePropertySet ...
6 years, 7 months ago (2014-05-08 12:38:54 UTC) #4
wibling-chromium
Thanks for the review! https://codereview.chromium.org/273843003/diff/20001/Source/core/css/StylePropertySet.h File Source/core/css/StylePropertySet.h (right): https://codereview.chromium.org/273843003/diff/20001/Source/core/css/StylePropertySet.h#newcode245 Source/core/css/StylePropertySet.h:245: inline MutableStylePropertySet* toMutableStylePropertySet(const RefPtrWillBeRawPtr<StylePropertySet>& set) ...
6 years, 7 months ago (2014-05-08 12:46:40 UTC) #5
haraken
https://codereview.chromium.org/273843003/diff/20001/Source/core/css/resolver/MatchedPropertiesCache.cpp File Source/core/css/resolver/MatchedPropertiesCache.cpp (right): https://codereview.chromium.org/273843003/diff/20001/Source/core/css/resolver/MatchedPropertiesCache.cpp#newcode151 Source/core/css/resolver/MatchedPropertiesCache.cpp:151: if (matchedProperties[i].properties->hasOneRef()) On 2014/05/08 12:38:55, wibling-chromium wrote: > On ...
6 years, 7 months ago (2014-05-08 12:53:37 UTC) #6
wibling-chromium
On 2014/05/08 12:53:37, haraken wrote: > https://codereview.chromium.org/273843003/diff/20001/Source/core/css/resolver/MatchedPropertiesCache.cpp > File Source/core/css/resolver/MatchedPropertiesCache.cpp (right): > > https://codereview.chromium.org/273843003/diff/20001/Source/core/css/resolver/MatchedPropertiesCache.cpp#newcode151 > ...
6 years, 7 months ago (2014-05-08 13:00:07 UTC) #7
haraken
On 2014/05/08 13:00:07, wibling-chromium wrote: > On 2014/05/08 12:53:37, haraken wrote: > > > https://codereview.chromium.org/273843003/diff/20001/Source/core/css/resolver/MatchedPropertiesCache.cpp ...
6 years, 7 months ago (2014-05-08 13:03:10 UTC) #8
wibling-chromium
On 2014/05/08 13:03:10, haraken wrote: > On 2014/05/08 13:00:07, wibling-chromium wrote: > > On 2014/05/08 ...
6 years, 7 months ago (2014-05-08 13:53:39 UTC) #9
wibling-chromium
PTAL. tasak@ or esprehn@ do you have time to take a look at this?
6 years, 7 months ago (2014-05-09 06:26:11 UTC) #10
esprehn
On 2014/05/09 06:26:11, wibling-chromium wrote: > PTAL. > > tasak@ or esprehn@ do you have ...
6 years, 7 months ago (2014-05-09 13:25:38 UTC) #11
haraken
Just a random idea: - Probably can we use thread-local weak processing (instead of normal ...
6 years, 7 months ago (2014-05-14 20:07:01 UTC) #12
esprehn
The hash table changes in this patch are not correct, like ElementDataCache::cachedShareableElementDataWithAttributes and the other ...
6 years, 7 months ago (2014-05-14 20:25:26 UTC) #13
haraken
> I'm also not comfortable with allowing dead pointers to live in the cache even ...
6 years, 7 months ago (2014-05-14 21:45:35 UTC) #14
wibling-chromium
Thanks for the review. I have replied inline below to your specific questions/comments. Given your ...
6 years, 7 months ago (2014-05-15 13:15:17 UTC) #15
haraken
Just a reminder: Any update on this CL? :)
6 years, 6 months ago (2014-06-10 15:30:41 UTC) #16
Mads Ager (chromium)
Yes, it is waiting for Erik's change to allow more flexible weak processing. Erik is ...
6 years, 6 months ago (2014-06-10 15:35:37 UTC) #17
wibling-chromium
PTAL. I have updated the change to use Erik's new ephemeron infrastructure.
6 years, 6 months ago (2014-06-24 15:11:14 UTC) #18
zerny-chromium
LGTM! This is the way it should be structured. Hurrah for custom weak processing and ...
6 years, 6 months ago (2014-06-25 06:19:02 UTC) #19
Mads Ager (chromium)
https://codereview.chromium.org/273843003/diff/100001/Source/core/css/resolver/MatchResult.h File Source/core/css/resolver/MatchResult.h (right): https://codereview.chromium.org/273843003/diff/100001/Source/core/css/resolver/MatchResult.h#newcode78 Source/core/css/resolver/MatchResult.h:78: namespace WTF { You can use WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(WebCore::MathcedProperties> here. https://codereview.chromium.org/273843003/diff/100001/Source/core/css/resolver/MatchResult.h#newcode92 ...
6 years, 6 months ago (2014-06-25 06:31:48 UTC) #20
Erik Corry
lgtm https://codereview.chromium.org/273843003/diff/100001/Source/core/css/resolver/MatchResult.h File Source/core/css/resolver/MatchResult.h (right): https://codereview.chromium.org/273843003/diff/100001/Source/core/css/resolver/MatchResult.h#newcode92 Source/core/css/resolver/MatchResult.h:92: WillBeHeapVector<MatchedProperties, 64> matchedProperties; On 2014/06/25 06:31:48, Mads Ager ...
6 years, 6 months ago (2014-06-25 06:58:25 UTC) #21
Mads Ager (chromium)
On 2014/06/25 06:58:25, Erik Corry wrote: > lgtm > > https://codereview.chromium.org/273843003/diff/100001/Source/core/css/resolver/MatchResult.h > File Source/core/css/resolver/MatchResult.h (right): ...
6 years, 6 months ago (2014-06-25 07:17:13 UTC) #22
wibling-chromium
Thanks for the reviews! I have updated the diff based on the feedback. https://codereview.chromium.org/273843003/diff/100001/Source/core/css/resolver/MatchResult.h File ...
6 years, 6 months ago (2014-06-25 09:03:28 UTC) #23
Mads Ager (chromium)
Thanks Gustav! LGTM https://codereview.chromium.org/273843003/diff/140001/Source/core/css/resolver/MatchedPropertiesCache.h File Source/core/css/resolver/MatchedPropertiesCache.h (right): https://codereview.chromium.org/273843003/diff/140001/Source/core/css/resolver/MatchedPropertiesCache.h#newcode64 Source/core/css/resolver/MatchedPropertiesCache.h:64: for (;it != end; ++it) { ...
6 years, 6 months ago (2014-06-25 09:18:33 UTC) #24
wibling-chromium
Thanks for the review! https://codereview.chromium.org/273843003/diff/140001/Source/core/css/resolver/MatchedPropertiesCache.h File Source/core/css/resolver/MatchedPropertiesCache.h (right): https://codereview.chromium.org/273843003/diff/140001/Source/core/css/resolver/MatchedPropertiesCache.h#newcode64 Source/core/css/resolver/MatchedPropertiesCache.h:64: for (;it != end; ++it) ...
6 years, 6 months ago (2014-06-25 09:30:47 UTC) #25
wibling-chromium
Elliott, Do you have time for a follow-up look at this. We now have support ...
6 years, 6 months ago (2014-06-25 09:39:20 UTC) #26
esprehn
On 2014/06/25 at 09:39:20, wibling wrote: > Elliott, > > Do you have time for ...
6 years, 6 months ago (2014-06-25 11:02:58 UTC) #27
wibling-chromium
On 2014/06/25 11:02:58, esprehn wrote: > On 2014/06/25 at 09:39:20, wibling wrote: > > Elliott, ...
6 years, 6 months ago (2014-06-25 11:14:33 UTC) #28
haraken
https://codereview.chromium.org/273843003/diff/180001/Source/core/css/resolver/MatchedPropertiesCache.cpp File Source/core/css/resolver/MatchedPropertiesCache.cpp (right): https://codereview.chromium.org/273843003/diff/180001/Source/core/css/resolver/MatchedPropertiesCache.cpp#newcode118 Source/core/css/resolver/MatchedPropertiesCache.cpp:118: WillBeHeapVector<unsigned, 16> toRemove; Shall we revert this back to ...
6 years, 6 months ago (2014-06-25 13:37:11 UTC) #29
wibling-chromium
Thanks for the review. I have replied below and will update the diff ASAP. https://codereview.chromium.org/273843003/diff/180001/Source/core/css/resolver/MatchedPropertiesCache.cpp ...
6 years, 6 months ago (2014-06-26 09:31:00 UTC) #30
esprehn
This lgtm, but this Oilpan stuff is making me nervous. All of these caches that ...
6 years, 6 months ago (2014-06-26 09:48:54 UTC) #31
wibling-chromium
On 2014/06/26 09:48:54, esprehn wrote: > This lgtm, but this Oilpan stuff is making me ...
6 years, 6 months ago (2014-06-26 09:58:41 UTC) #32
wibling-chromium
https://codereview.chromium.org/273843003/diff/180001/Source/core/dom/PresentationAttributeStyle.cpp File Source/core/dom/PresentationAttributeStyle.cpp (right): https://codereview.chromium.org/273843003/diff/180001/Source/core/dom/PresentationAttributeStyle.cpp#newcode78 Source/core/dom/PresentationAttributeStyle.cpp:78: #endif // ENABLE(OILPAN) On 2014/06/25 13:37:11, haraken wrote: > ...
6 years, 6 months ago (2014-06-26 09:59:41 UTC) #33
Mads Ager (chromium)
On 2014/06/26 09:59:41, wibling-chromium wrote: > https://codereview.chromium.org/273843003/diff/180001/Source/core/dom/PresentationAttributeStyle.cpp > File Source/core/dom/PresentationAttributeStyle.cpp (right): > > https://codereview.chromium.org/273843003/diff/180001/Source/core/dom/PresentationAttributeStyle.cpp#newcode78 > ...
6 years, 6 months ago (2014-06-26 10:03:17 UTC) #34
haraken
LGTM https://codereview.chromium.org/273843003/diff/180001/Source/core/css/resolver/MatchedPropertiesCache.h File Source/core/css/resolver/MatchedPropertiesCache.h (right): https://codereview.chromium.org/273843003/diff/180001/Source/core/css/resolver/MatchedPropertiesCache.h#newcode105 Source/core/css/resolver/MatchedPropertiesCache.h:105: typedef HeapHashMap<unsigned, Member<CachedMatchedProperties>, DefaultHash<unsigned>::Hash, HashTraits<unsigned>, CachedMatchedPropertiesHashTraits > Cache; ...
6 years, 6 months ago (2014-06-26 10:31:36 UTC) #35
wibling-chromium
On 2014/06/26 10:03:17, Mads Ager (chromium) wrote: > On 2014/06/26 09:59:41, wibling-chromium wrote: > > ...
6 years, 6 months ago (2014-06-26 10:36:50 UTC) #36
wibling-chromium
The CQ bit was checked by wibling@chromium.org
6 years, 6 months ago (2014-06-26 10:37:30 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wibling@chromium.org/273843003/240001
6 years, 6 months ago (2014-06-26 10:38:20 UTC) #38
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_gn_rel on tryserver.blink ...
6 years, 6 months ago (2014-06-26 11:46:37 UTC) #39
commit-bot: I haz the power
6 years, 6 months ago (2014-06-26 18:14:55 UTC) #40
Message was sent while issue was closed.
Change committed as 177012

Powered by Google App Engine
This is Rietveld 408576698