Changeset 201559 in webkit
- Timestamp:
- Jun 1, 2016, 11:14:25 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
css/CSSParser.cpp (modified) (1 diff)
-
css/CSSProperty.cpp (modified) (1 diff)
-
css/StylePropertyShorthand.cpp (modified) (1 diff)
-
css/StylePropertyShorthand.h (modified) (1 diff)
-
css/makeprop.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r201557 r201559 1 2016-06-01 Andreas Kling <akling@apple.com> 2 3 Use inline capacity for StylePropertyShorthand Vectors. 4 <https://webkit.org/b/158260> 5 6 Reviewed by Antti Koivisto. 7 8 Vector<StylePropertyShorthand> was a huge source of heap allocations, 9 just over 0.5% of all fastMalloc() bytes on PLUM. Giving it an inline capacity 10 of 4 turns all of it into stack allocations. 11 12 * css/CSSParser.cpp: 13 (WebCore::CSSParser::addProperty): 14 * css/CSSProperty.cpp: 15 (WebCore::StylePropertyMetadata::shorthandID): 16 * css/StylePropertyShorthand.cpp: 17 (WebCore::indexOfShorthandForLonghand): 18 * css/StylePropertyShorthand.h: 19 * css/makeprop.pl: 20 (constructShorthandsVector): 21 1 22 2016-06-01 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr> 2 23 -
trunk/Source/WebCore/css/CSSParser.cpp
r201498 r201559 1610 1610 } 1611 1611 1612 Vector<StylePropertyShorthand>shorthands = matchingShorthandsForLonghand(propId);1612 auto shorthands = matchingShorthandsForLonghand(propId); 1613 1613 if (shorthands.size() == 1) 1614 1614 m_parsedProperties.append(CSSProperty(propId, WTFMove(value), important, true, CSSPropertyInvalid, m_implicitShorthand || implicit)); -
trunk/Source/WebCore/css/CSSProperty.cpp
r201113 r201559 44 44 return CSSPropertyInvalid; 45 45 46 Vector<StylePropertyShorthand>shorthands = matchingShorthandsForLonghand(static_cast<CSSPropertyID>(m_propertyID));46 auto shorthands = matchingShorthandsForLonghand(static_cast<CSSPropertyID>(m_propertyID)); 47 47 ASSERT(shorthands.size() && m_indexInShorthandsVector >= 0 && m_indexInShorthandsVector < shorthands.size()); 48 48 return shorthands[m_indexInShorthandsVector].id(); -
trunk/Source/WebCore/css/StylePropertyShorthand.cpp
r201113 r201559 69 69 } 70 70 71 unsigned indexOfShorthandForLonghand(CSSPropertyID shorthandID, const Vector<StylePropertyShorthand>& shorthands)71 unsigned indexOfShorthandForLonghand(CSSPropertyID shorthandID, const StylePropertyShorthandVector& shorthands) 72 72 { 73 73 for (unsigned i = 0, size = shorthands.size(); i < size; ++i) { -
trunk/Source/WebCore/css/StylePropertyShorthand.h
r201113 r201559 62 62 // Return the list of shorthands for a given longhand. 63 63 // The implementation is generated in StylePropertyShorthandFunctions.cpp. 64 Vector<StylePropertyShorthand> matchingShorthandsForLonghand(CSSPropertyID); 64 using StylePropertyShorthandVector = Vector<StylePropertyShorthand, 4>; 65 StylePropertyShorthandVector matchingShorthandsForLonghand(CSSPropertyID); 65 66 66 unsigned indexOfShorthandForLonghand(CSSPropertyID, const Vector<StylePropertyShorthand>&);67 unsigned indexOfShorthandForLonghand(CSSPropertyID, const StylePropertyShorthandVector&); 67 68 68 69 bool isShorthandCSSProperty(CSSPropertyID); -
trunk/Source/WebCore/css/makeprop.pl
r195582 r201559 1006 1006 1007 1007 print SHORTHANDS_CPP << "EOF"; 1008 Vector<StylePropertyShorthand>matchingShorthandsForLonghand(CSSPropertyID propertyID)1008 StylePropertyShorthandVector matchingShorthandsForLonghand(CSSPropertyID propertyID) 1009 1009 { 1010 1010 switch (propertyID) { … … 1014 1014 my $shorthands = shift; 1015 1015 1016 my $vector = " Vector<StylePropertyShorthand>{";1016 my $vector = "StylePropertyShorthandVector{"; 1017 1017 foreach my $i (0 .. $#$shorthands) { 1018 1018 $vector .= ", " unless $i == 0;
Note:
See TracChangeset
for help on using the changeset viewer.