Changeset 195304 in webkit
- Timestamp:
- Jan 19, 2016 12:16:01 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r195300 r195304 1 2016-01-19 Chris Dumez <cdumez@apple.com> 2 3 Unreviewed, rolling out r195141. 4 5 Seems to cause crashes on iOS9 64bit 6 7 Reverted changeset: 8 9 "Fragmentation-free allocator for timeless and/or coupled 10 allocations." 11 https://bugs.webkit.org/show_bug.cgi?id=152696 12 http://trac.webkit.org/changeset/195141 13 1 14 2016-01-19 Enrica Casucci <enrica@apple.com> 2 15 -
trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj
r195142 r195304 54 54 <ClCompile Include="..\wtf\Assertions.cpp" /> 55 55 <ClCompile Include="..\wtf\BitVector.cpp" /> 56 <ClCompile Include="..\wtf\BumpArena.cpp" />57 56 <ClCompile Include="..\wtf\CompilationThread.cpp" /> 58 57 <ClCompile Include="..\wtf\CryptographicUtilities.cpp" /> -
trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters
r195141 r195304 119 119 </ClCompile> 120 120 <ClCompile Include="..\wtf\BitVector.cpp"> 121 <Filter>wtf</Filter>122 </ClCompile>123 <ClCompile Include="..\wtf\BumpArena.cpp">124 121 <Filter>wtf</Filter> 125 122 </ClCompile> -
trunk/Source/WTF/WTF.xcodeproj/project.pbxproj
r195142 r195304 289 289 A8A47487151A825B004123FF /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; }; 290 290 A8A4748C151A8264004123FF /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4748B151A8264004123FF /* config.h */; }; 291 AD9C50C11C3C1D5D005FBF1E /* BumpArena.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD9C50BF1C3C1D5D005FBF1E /* BumpArena.cpp */; };292 AD9C50C21C3C1D5D005FBF1E /* BumpArena.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9C50C01C3C1D5D005FBF1E /* BumpArena.h */; settings = {ATTRIBUTES = (Private, ); }; };293 291 B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; }; 294 292 C4F8A93719C65EB400B2B15D /* Stopwatch.h in Headers */ = {isa = PBXBuildFile; fileRef = C4F8A93619C65EB400B2B15D /* Stopwatch.h */; }; … … 605 603 A8A4737B151A825B004123FF /* WTFThreadData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFThreadData.h; sourceTree = "<group>"; }; 606 604 A8A4748B151A8264004123FF /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; }; 607 AD9C50BF1C3C1D5D005FBF1E /* BumpArena.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BumpArena.cpp; sourceTree = "<group>"; };608 AD9C50C01C3C1D5D005FBF1E /* BumpArena.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BumpArena.h; sourceTree = "<group>"; };609 605 B38FD7BC168953E80065C969 /* FeatureDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeatureDefines.h; sourceTree = "<group>"; }; 610 606 C4F8A93619C65EB400B2B15D /* Stopwatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stopwatch.h; sourceTree = "<group>"; }; … … 764 760 0F93274A1C17F4B700CF6564 /* Box.h */, 765 761 0F4570441BE834410062A629 /* BubbleSort.h */, 766 AD9C50BF1C3C1D5D005FBF1E /* BumpArena.cpp */,767 AD9C50C01C3C1D5D005FBF1E /* BumpArena.h */,768 762 A8A47267151A825A004123FF /* BumpPointerAllocator.h */, 769 763 EB95E1EF161A72410089A2F5 /* ByteOrder.h */, … … 1272 1266 A8A4743F151A825B004123FF /* StringHash.h in Headers */, 1273 1267 A748745417A0BDAE00FA04CB /* StringHashDumpContext.h in Headers */, 1274 AD9C50C21C3C1D5D005FBF1E /* BumpArena.h in Headers */,1275 1268 A8A47441151A825B004123FF /* StringImpl.h in Headers */, 1276 1269 A8A47442151A825B004123FF /* StringOperators.h in Headers */, … … 1416 1409 9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */, 1417 1410 1469419D16EAB10A0024E146 /* AutodrainedPoolMac.mm in Sources */, 1418 AD9C50C11C3C1D5D005FBF1E /* BumpArena.cpp in Sources */,1419 1411 8134013815B092FD001FF0B8 /* Base64.cpp in Sources */, 1420 1412 A8A473A8151A825B004123FF /* bignum-dtoa.cc in Sources */, -
trunk/Source/WTF/wtf/CMakeLists.txt
r195183 r195304 8 8 Bitmap.h 9 9 BubbleSort.h 10 BumpArena.h11 10 BumpPointerAllocator.h 12 11 ByteOrder.h … … 156 155 Atomics.cpp 157 156 BitVector.cpp 158 BumpArena.cpp159 157 CompilationThread.cpp 160 158 CryptographicUtilities.cpp -
trunk/Source/WebCore/ChangeLog
r195302 r195304 1 2016-01-19 Chris Dumez <cdumez@apple.com> 2 3 Unreviewed, rolling out r195141. 4 5 Seems to cause crashes on iOS9 64bit 6 7 Reverted changeset: 8 9 "Fragmentation-free allocator for timeless and/or coupled 10 allocations." 11 https://bugs.webkit.org/show_bug.cgi?id=152696 12 http://trac.webkit.org/changeset/195141 13 1 14 2015-12-07 Jer Noble <jer.noble@apple.com> 2 15 -
trunk/Source/WebCore/css/CSSGrammar.y.in
r195179 r195304 404 404 if ($4) { 405 405 if (parser->m_selectorListForParseSelector) 406 parser->m_selectorListForParseSelector->adoptSelectorVector( parser->arena(),*$4);406 parser->m_selectorListForParseSelector->adoptSelectorVector(*$4); 407 407 parser->recycleSelectorVector(std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4)); 408 408 } … … 1354 1354 // used by ::cue(:past/:future) 1355 1355 | ':' ':' CUEFUNCTION maybe_space simple_selector_list maybe_space ')' { 1356 $$ = CSSParserSelector::parsePseudoElementCueFunctionSelector( parser->arena(),$3, $5);1356 $$ = CSSParserSelector::parsePseudoElementCueFunctionSelector($3, $5); 1357 1357 } 1358 1358 #endif … … 1367 1367 auto selector = std::make_unique<CSSParserSelector>(); 1368 1368 selector->setMatch(CSSSelector::PseudoClass); 1369 selector->adoptSelectorVector( parser->arena(),*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));1369 selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4)); 1370 1370 selector->setPseudoClassValue($2); 1371 1371 if (selector->pseudoClassType() == CSSSelector::PseudoClassAny) … … 1378 1378 auto selector = std::make_unique<CSSParserSelector>(); 1379 1379 selector->setMatch(CSSSelector::PseudoClass); 1380 selector->adoptSelectorVector( parser->arena(),*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4));1380 selector->adoptSelectorVector(*std::unique_ptr<Vector<std::unique_ptr<CSSParserSelector>>>($4)); 1381 1381 selector->setPseudoClassValue($2); 1382 1382 if (selector->pseudoClassType() == CSSSelector::PseudoClassMatches) … … 1428 1428 selector->setPseudoClassValue($2); 1429 1429 if (ending) 1430 selector->adoptSelectorVector( parser->arena(),*ending);1430 selector->adoptSelectorVector(*ending); 1431 1431 CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType(); 1432 1432 if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild) … … 1443 1443 selector->setPseudoClassValue($2); 1444 1444 if (ending) 1445 selector->adoptSelectorVector( parser->arena(),*ending);1445 selector->adoptSelectorVector(*ending); 1446 1446 CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType(); 1447 1447 if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild) … … 1458 1458 selector->setPseudoClassValue($2); 1459 1459 if (ending) 1460 selector->adoptSelectorVector( parser->arena(),*ending);1460 selector->adoptSelectorVector(*ending); 1461 1461 CSSSelector::PseudoClassType pseudoClassType = selector->pseudoClassType(); 1462 1462 if (pseudoClassType == CSSSelector::PseudoClassNthChild || pseudoClassType == CSSSelector::PseudoClassNthLastChild) … … 1512 1512 selector->setMatch(CSSSelector::PseudoClass); 1513 1513 selector->setPseudoClassValue($2); 1514 selector->adoptSelectorVector( parser->arena(),*list);1514 selector->adoptSelectorVector(*list); 1515 1515 if (selector->pseudoClassType() == CSSSelector::PseudoClassNot) 1516 1516 $$ = selector.release(); -
trunk/Source/WebCore/css/CSSKeyframesRule.h
r195141 r195304 41 41 class StyleRuleKeyframes : public StyleRuleBase { 42 42 public: 43 static Ref<StyleRuleKeyframes> create( BumpArena* arena) { return adoptRef(*new (arena) StyleRuleKeyframes); }43 static Ref<StyleRuleKeyframes> create() { return adoptRef(*new StyleRuleKeyframes()); } 44 44 45 45 ~StyleRuleKeyframes(); -
trunk/Source/WebCore/css/CSSParser.cpp
r195141 r195304 1645 1645 results.remove(0, unusedEntries); 1646 1646 1647 return ImmutableStyleProperties::create( arena(),results.data(), results.size(), m_context.mode);1647 return ImmutableStyleProperties::create(results.data(), results.size(), m_context.mode); 1648 1648 } 1649 1649 … … 12702 12702 // To comply with w3c test suite expectation, create an empty media query 12703 12703 // even when it is syntactically incorrect. 12704 rule = StyleRuleMedia::create( arena(),MediaQuerySet::create(), emptyRules);12704 rule = StyleRuleMedia::create(MediaQuerySet::create(), emptyRules); 12705 12705 } else 12706 rule = StyleRuleMedia::create( arena(),media, rules ? *rules : emptyRules);12706 rule = StyleRuleMedia::create(media, rules ? *rules : emptyRules); 12707 12707 processAndAddNewRuleToSourceTreeIfNeeded(); 12708 12708 return rule; … … 12730 12730 12731 12731 if (rules) 12732 rule = StyleRuleSupports::create( arena(),conditionText, conditionIsSupported, *rules);12732 rule = StyleRuleSupports::create(conditionText, conditionIsSupported, *rules); 12733 12733 else { 12734 12734 RuleList emptyRules; 12735 rule = StyleRuleSupports::create( arena(),conditionText, conditionIsSupported, emptyRules);12735 rule = StyleRuleSupports::create(conditionText, conditionIsSupported, emptyRules); 12736 12736 } 12737 12737 … … 12842 12842 std::unique_ptr<Vector<RefPtr<StyleKeyframe>>> keyframes = WTFMove(popKeyframes); 12843 12843 m_allowImportRules = m_allowNamespaceDeclarations = false; 12844 RefPtr<StyleRuleKeyframes> rule = StyleRuleKeyframes::create( arena());12844 RefPtr<StyleRuleKeyframes> rule = StyleRuleKeyframes::create(); 12845 12845 for (size_t i = 0; i < keyframes->size(); ++i) 12846 12846 rule->parserAppendKeyframe(keyframes->at(i)); … … 12850 12850 } 12851 12851 12852 void CSSParser::setArena(BumpArena& arena)12853 {12854 m_arena = &arena;12855 }12856 12857 BumpArena* CSSParser::arena()12858 {12859 return m_arena.get();12860 }12861 12862 12852 RefPtr<StyleRuleBase> CSSParser::createStyleRule(Vector<std::unique_ptr<CSSParserSelector>>* selectors) 12863 12853 { … … 12866 12856 m_allowImportRules = false; 12867 12857 m_allowNamespaceDeclarations = false; 12868 rule = StyleRule::create( arena(),m_lastSelectorLineNumber, createStyleProperties());12869 rule->parserAdoptSelectorVector( arena(),*selectors);12858 rule = StyleRule::create(m_lastSelectorLineNumber, createStyleProperties()); 12859 rule->parserAdoptSelectorVector(*selectors); 12870 12860 processAndAddNewRuleToSourceTreeIfNeeded(); 12871 12861 } else … … 12890 12880 } 12891 12881 } 12892 RefPtr<StyleRuleFontFace> rule = StyleRuleFontFace::create( arena(),createStyleProperties());12882 RefPtr<StyleRuleFontFace> rule = StyleRuleFontFace::create(createStyleProperties()); 12893 12883 clearProperties(); 12894 12884 processAndAddNewRuleToSourceTreeIfNeeded(); … … 12974 12964 RefPtr<StyleRulePage> rule; 12975 12965 if (pageSelector) { 12976 rule = StyleRulePage::create( arena(),createStyleProperties());12966 rule = StyleRulePage::create(createStyleProperties()); 12977 12967 Vector<std::unique_ptr<CSSParserSelector>> selectorVector; 12978 12968 selectorVector.append(WTFMove(pageSelector)); 12979 rule->parserAdoptSelectorVector( arena(),selectorVector);12969 rule->parserAdoptSelectorVector(selectorVector); 12980 12970 processAndAddNewRuleToSourceTreeIfNeeded(); 12981 12971 } else … … 13009 12999 m_allowImportRules = m_allowNamespaceDeclarations = false; 13010 13000 13011 RefPtr<StyleRuleRegion> regionRule = StyleRuleRegion::create( arena(),regionSelector, *rules);13001 RefPtr<StyleRuleRegion> regionRule = StyleRuleRegion::create(regionSelector, *rules); 13012 13002 13013 13003 if (isExtractingSourceData()) … … 13283 13273 m_allowImportRules = m_allowNamespaceDeclarations = false; 13284 13274 13285 RefPtr<StyleRuleViewport> rule = StyleRuleViewport::create( arena(),createStyleProperties());13275 RefPtr<StyleRuleViewport> rule = StyleRuleViewport::create(createStyleProperties()); 13286 13276 clearProperties(); 13287 13277 -
trunk/Source/WebCore/css/CSSParser.h
r195141 r195304 37 37 #include "WebKitCSSFilterValue.h" 38 38 #include <memory> 39 #include <wtf/BumpArena.h>40 39 #include <wtf/HashMap.h> 41 40 #include <wtf/HashSet.h> … … 116 115 WEBCORE_EXPORT ~CSSParser(); 117 116 118 void setArena(BumpArena&);119 120 117 void parseSheet(StyleSheetContents*, const String&, const TextPosition&, RuleSourceDataList*, bool logErrors); 121 118 RefPtr<StyleRuleBase> parseRule(StyleSheetContents*, const String&); … … 401 398 CSSParserContext m_context; 402 399 403 BumpArena* arena();404 RefPtr<BumpArena> m_arena;405 400 bool m_important; 406 401 CSSPropertyID m_id; -
trunk/Source/WebCore/css/CSSParserValues.cpp
r195141 r195304 215 215 216 216 #if ENABLE(VIDEO_TRACK) 217 CSSParserSelector* CSSParserSelector::parsePseudoElementCueFunctionSelector( BumpArena* arena,const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* parsedSelectorVector)217 CSSParserSelector* CSSParserSelector::parsePseudoElementCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* parsedSelectorVector) 218 218 { 219 219 ASSERT_UNUSED(functionIdentifier, String(functionIdentifier) == "cue("); … … 227 227 selector->m_selector->setMatch(CSSSelector::PseudoElement); 228 228 selector->m_selector->setPseudoElementType(CSSSelector::PseudoElementCue); 229 selector->adoptSelectorVector( arena,*selectorVector);229 selector->adoptSelectorVector(*selectorVector); 230 230 return selector.release(); 231 231 } … … 280 280 } 281 281 282 void CSSParserSelector::adoptSelectorVector( BumpArena* arena,Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)282 void CSSParserSelector::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector) 283 283 { 284 284 auto selectorList = std::make_unique<CSSSelectorList>(); 285 selectorList->adoptSelectorVector( arena,selectorVector);285 selectorList->adoptSelectorVector(selectorVector); 286 286 m_selector->setSelectorList(WTFMove(selectorList)); 287 287 } -
trunk/Source/WebCore/css/CSSParserValues.h
r195141 r195304 25 25 #include "CSSValueKeywords.h" 26 26 #include "CSSValueList.h" 27 #include <wtf/BumpArena.h>28 27 #include <wtf/text/AtomicString.h> 29 28 #include <wtf/text/AtomicStringHash.h> … … 213 212 static CSSParserSelector* parsePagePseudoSelector(const CSSParserString& pseudoTypeString); 214 213 static CSSParserSelector* parsePseudoElementSelector(CSSParserString& pseudoTypeString); 215 static CSSParserSelector* parsePseudoElementCueFunctionSelector( BumpArena*,const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* selectorVector);214 static CSSParserSelector* parsePseudoElementCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* selectorVector); 216 215 static CSSParserSelector* parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString); 217 216 … … 230 229 void setForPage() { m_selector->setForPage(); } 231 230 232 void adoptSelectorVector( BumpArena*,Vector<std::unique_ptr<CSSParserSelector>>& selectorVector);231 void adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector); 233 232 void setLangArgumentList(const Vector<CSSParserString>& stringVector); 234 233 -
trunk/Source/WebCore/css/CSSSelectorList.cpp
r195141 r195304 38 38 ASSERT_WITH_SECURITY_IMPLICATION(otherComponentCount); 39 39 40 m_selectorArray = reinterpret_cast<CSSSelector*>( BumpArena::allocate(BumpArena::arenaFor(other.m_selectorArray),sizeof(CSSSelector) * otherComponentCount));40 m_selectorArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelector) * otherComponentCount)); 41 41 for (unsigned i = 0; i < otherComponentCount; ++i) 42 42 new (NotNull, &m_selectorArray[i]) CSSSelector(other.m_selectorArray[i]); … … 50 50 } 51 51 52 void CSSSelectorList::adoptSelectorVector( BumpArena* arena,Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)52 void CSSSelectorList::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector) 53 53 { 54 54 ASSERT_WITH_SECURITY_IMPLICATION(!selectorVector.isEmpty()); … … 61 61 } 62 62 ASSERT(flattenedSize); 63 m_selectorArray = reinterpret_cast<CSSSelector*>( BumpArena::allocate(arena,sizeof(CSSSelector) * flattenedSize));63 m_selectorArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelector) * flattenedSize)); 64 64 size_t arrayIndex = 0; 65 65 for (size_t i = 0; i < selectorVector.size(); ++i) { … … 120 120 s->~CSSSelector(); 121 121 } 122 BumpArena::deallocate(selectorArray);122 fastFree(selectorArray); 123 123 } 124 124 -
trunk/Source/WebCore/css/CSSSelectorList.h
r195141 r195304 29 29 #include "CSSSelector.h" 30 30 #include <memory> 31 #include <wtf/BumpArena.h>32 31 33 32 namespace WebCore { … … 44 43 ~CSSSelectorList() { deleteSelectors(); } 45 44 46 void adoptSelectorVector( BumpArena*, Vector<std::unique_ptr<CSSParserSelector>>&);45 void adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector); 47 46 void adoptSelectorArray(CSSSelector* selectors) { ASSERT(!m_selectorArray); m_selectorArray = selectors; } 48 47 -
trunk/Source/WebCore/css/StyleProperties.cpp
r195141 r195304 56 56 } 57 57 58 Ref<ImmutableStyleProperties> ImmutableStyleProperties::create( BumpArena* arena,const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)59 { 60 void* slot = BumpArena::allocate(arena,sizeForImmutableStylePropertiesWithPropertyCount(count));58 Ref<ImmutableStyleProperties> ImmutableStyleProperties::create(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode) 59 { 60 void* slot = WTF::fastMalloc(sizeForImmutableStylePropertiesWithPropertyCount(count)); 61 61 return adoptRef(*new (NotNull, slot) ImmutableStyleProperties(properties, count, cssParserMode)); 62 62 } … … 67 67 return downcast<ImmutableStyleProperties>(const_cast<StyleProperties&>(*this)); 68 68 const MutableStyleProperties& mutableThis = downcast<MutableStyleProperties>(*this); 69 return ImmutableStyleProperties::create( BumpArena::arenaFor(this),mutableThis.m_propertyVector.data(), mutableThis.m_propertyVector.size(), cssParserMode());69 return ImmutableStyleProperties::create(mutableThis.m_propertyVector.data(), mutableThis.m_propertyVector.size(), cssParserMode()); 70 70 } 71 71 -
trunk/Source/WebCore/css/StyleProperties.h
r195141 r195304 30 30 #include "CSSValueKeywords.h" 31 31 #include <memory> 32 #include <wtf/BumpArena.h>33 32 #include <wtf/ListHashSet.h> 34 33 #include <wtf/TypeCasts.h> … … 48 47 class StyleSheetContents; 49 48 50 class StyleProperties : public WTF::RefCountedBase { 51 WTF_MAKE_BUMPARENA_ALLOCATED; 49 class StyleProperties : public RefCounted<StyleProperties> { 52 50 friend class PropertyReference; 53 51 public: … … 164 162 public: 165 163 WEBCORE_EXPORT ~ImmutableStyleProperties(); 166 static Ref<ImmutableStyleProperties> create( BumpArena*,const CSSProperty* properties, unsigned count, CSSParserMode);164 static Ref<ImmutableStyleProperties> create(const CSSProperty* properties, unsigned count, CSSParserMode); 167 165 168 166 unsigned propertyCount() const { return m_arraySize; } -
trunk/Source/WebCore/css/StyleRule.cpp
r195141 r195304 220 220 } 221 221 222 Ref<StyleRule> StyleRule::create( BumpArena* arena,int sourceLine, const Vector<const CSSSelector*>& selectors, Ref<StyleProperties>&& properties)222 Ref<StyleRule> StyleRule::create(int sourceLine, const Vector<const CSSSelector*>& selectors, Ref<StyleProperties>&& properties) 223 223 { 224 224 ASSERT_WITH_SECURITY_IMPLICATION(!selectors.isEmpty()); 225 CSSSelector* selectorListArray = reinterpret_cast<CSSSelector*>( BumpArena::allocate(arena,sizeof(CSSSelector) * selectors.size()));225 CSSSelector* selectorListArray = reinterpret_cast<CSSSelector*>(fastMalloc(sizeof(CSSSelector) * selectors.size())); 226 226 for (unsigned i = 0; i < selectors.size(); ++i) 227 227 new (NotNull, &selectorListArray[i]) CSSSelector(*selectors.at(i)); 228 228 selectorListArray[selectors.size() - 1].setLastInSelectorList(); 229 auto rule = StyleRule::create( arena,sourceLine, WTFMove(properties));229 auto rule = StyleRule::create(sourceLine, WTFMove(properties)); 230 230 rule.get().parserAdoptSelectorArray(selectorListArray); 231 231 return rule; … … 245 245 246 246 if (componentsInThisSelector.size() + componentsSinceLastSplit.size() > maxCount && !componentsSinceLastSplit.isEmpty()) { 247 rules.append(create( BumpArena::arenaFor(this),sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));247 rules.append(create(sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get()))); 248 248 componentsSinceLastSplit.clear(); 249 249 } … … 253 253 254 254 if (!componentsSinceLastSplit.isEmpty()) 255 rules.append(create( BumpArena::arenaFor(this),sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get())));255 rules.append(create(sourceLine(), componentsSinceLastSplit, const_cast<StyleProperties&>(m_properties.get()))); 256 256 257 257 return rules; … … 361 361 : StyleRuleGroup(Region, adoptRules) 362 362 { 363 m_selectorList.adoptSelectorVector( BumpArena::arenaFor(this),*selectors);363 m_selectorList.adoptSelectorVector(*selectors); 364 364 } 365 365 -
trunk/Source/WebCore/css/StyleRule.h
r195141 r195304 26 26 #include "MediaList.h" 27 27 #include "StyleProperties.h" 28 #include <wtf/BumpArena.h>29 28 #include <wtf/RefPtr.h> 30 29 #include <wtf/TypeCasts.h> … … 39 38 40 39 class StyleRuleBase : public WTF::RefCountedBase { 41 WTF_MAKE_ BUMPARENA_ALLOCATED;40 WTF_MAKE_FAST_ALLOCATED; 42 41 public: 43 42 enum Type { … … 103 102 104 103 class StyleRule : public StyleRuleBase { 105 public: 106 static Ref<StyleRule> create(BumpArena* arena, int sourceLine, Ref<StyleProperties>&& properties) 107 { 108 return adoptRef(*new (arena) StyleRule(sourceLine, WTFMove(properties))); 104 WTF_MAKE_FAST_ALLOCATED; 105 public: 106 static Ref<StyleRule> create(int sourceLine, Ref<StyleProperties>&& properties) 107 { 108 return adoptRef(*new StyleRule(sourceLine, WTFMove(properties))); 109 109 } 110 110 … … 115 115 MutableStyleProperties& mutableProperties(); 116 116 117 void parserAdoptSelectorVector( BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(arena,selectors); }117 void parserAdoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(selectors); } 118 118 void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList = WTFMove(selectors); } 119 119 void parserAdoptSelectorArray(CSSSelector* selectors) { m_selectorList.adoptSelectorArray(selectors); } … … 129 129 StyleRule(const StyleRule&); 130 130 131 static Ref<StyleRule> create( BumpArena*,int sourceLine, const Vector<const CSSSelector*>&, Ref<StyleProperties>&&);131 static Ref<StyleRule> create(int sourceLine, const Vector<const CSSSelector*>&, Ref<StyleProperties>&&); 132 132 133 133 Ref<StyleProperties> m_properties; … … 137 137 class StyleRuleFontFace : public StyleRuleBase { 138 138 public: 139 static Ref<StyleRuleFontFace> create( BumpArena* arena, Ref<StyleProperties>&& properties) { return adoptRef(*new (arena)StyleRuleFontFace(WTFMove(properties))); }139 static Ref<StyleRuleFontFace> create(Ref<StyleProperties>&& properties) { return adoptRef(*new StyleRuleFontFace(WTFMove(properties))); } 140 140 141 141 ~StyleRuleFontFace(); … … 156 156 class StyleRulePage : public StyleRuleBase { 157 157 public: 158 static Ref<StyleRulePage> create( BumpArena* arena, Ref<StyleProperties>&& properties) { return adoptRef(*new (arena)StyleRulePage(WTFMove(properties))); }158 static Ref<StyleRulePage> create(Ref<StyleProperties>&& properties) { return adoptRef(*new StyleRulePage(WTFMove(properties))); } 159 159 160 160 ~StyleRulePage(); … … 164 164 MutableStyleProperties& mutableProperties(); 165 165 166 void parserAdoptSelectorVector( BumpArena* arena, Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(arena,selectors); }166 void parserAdoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectors) { m_selectorList.adoptSelectorVector(selectors); } 167 167 void wrapperAdoptSelectorList(CSSSelectorList& selectors) { m_selectorList = WTFMove(selectors); } 168 168 … … 194 194 class StyleRuleMedia : public StyleRuleGroup { 195 195 public: 196 static Ref<StyleRuleMedia> create( BumpArena* arena,PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase>>& adoptRules)197 { 198 return adoptRef(*new (arena)StyleRuleMedia(media, adoptRules));196 static Ref<StyleRuleMedia> create(PassRefPtr<MediaQuerySet> media, Vector<RefPtr<StyleRuleBase>>& adoptRules) 197 { 198 return adoptRef(*new StyleRuleMedia(media, adoptRules)); 199 199 } 200 200 … … 212 212 class StyleRuleSupports : public StyleRuleGroup { 213 213 public: 214 static Ref<StyleRuleSupports> create( BumpArena* arena,const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase>>& adoptRules)215 { 216 return adoptRef(*new (arena)StyleRuleSupports(conditionText, conditionIsSupported, adoptRules));214 static Ref<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase>>& adoptRules) 215 { 216 return adoptRef(*new StyleRuleSupports(conditionText, conditionIsSupported, adoptRules)); 217 217 } 218 218 … … 231 231 class StyleRuleRegion : public StyleRuleGroup { 232 232 public: 233 static Ref<StyleRuleRegion> create( BumpArena* arena,Vector<std::unique_ptr<CSSParserSelector>>* selectors, Vector<RefPtr<StyleRuleBase>>& adoptRules)234 { 235 return adoptRef(*new (arena)StyleRuleRegion(selectors, adoptRules));233 static Ref<StyleRuleRegion> create(Vector<std::unique_ptr<CSSParserSelector>>* selectors, Vector<RefPtr<StyleRuleBase>>& adoptRules) 234 { 235 return adoptRef(*new StyleRuleRegion(selectors, adoptRules)); 236 236 } 237 237 … … 250 250 class StyleRuleViewport : public StyleRuleBase { 251 251 public: 252 static Ref<StyleRuleViewport> create( BumpArena* arena, Ref<StyleProperties>&& properties) { return adoptRef(*new (arena)StyleRuleViewport(WTFMove(properties))); }252 static Ref<StyleRuleViewport> create(Ref<StyleProperties>&& properties) { return adoptRef(*new StyleRuleViewport(WTFMove(properties))); } 253 253 254 254 ~StyleRuleViewport(); -
trunk/Source/WebCore/css/StyleSheetContents.cpp
r195141 r195304 72 72 , m_isInMemoryCache(false) 73 73 , m_parserContext(context) 74 , m_arena(BumpArena::create())75 74 { 76 75 } … … 93 92 , m_isInMemoryCache(false) 94 93 , m_parserContext(o.m_parserContext) 95 , m_arena(BumpArena::create())96 94 { 97 95 ASSERT(o.isCacheable()); … … 316 314 317 315 CSSParser p(parserContext()); 318 p.setArena(m_arena.get());319 316 p.parseSheet(this, sheetText, TextPosition(), nullptr, true); 320 317 … … 338 335 { 339 336 CSSParser p(parserContext()); 340 p.setArena(m_arena.get());341 337 p.parseSheet(this, sheetText, textPosition, nullptr, createdByParser); 342 338 return true; -
trunk/Source/WebCore/css/StyleSheetContents.h
r195141 r195304 25 25 #include "CachePolicy.h" 26 26 #include "URL.h" 27 #include <wtf/BumpArena.h>28 27 #include <wtf/HashMap.h> 29 28 #include <wtf/ListHashSet.h> … … 175 174 176 175 Vector<CSSStyleSheet*> m_clients; 177 178 Ref<BumpArena> m_arena;179 176 }; 180 177 -
trunk/Source/WebCore/dom/SelectorQuery.cpp
r195293 r195304 609 609 } 610 610 611 SelectorQueryCache::SelectorQueryCache()612 : m_arena(BumpArena::create())613 {614 }615 616 611 SelectorQuery* SelectorQueryCache::add(const String& selectors, Document& document, ExceptionCode& ec) 617 612 { … … 621 616 622 617 CSSParser parser(document); 623 parser.setArena(m_arena.get());624 618 CSSSelectorList selectorList; 625 619 parser.parseSelector(selectors, selectorList); -
trunk/Source/WebCore/dom/SelectorQuery.h
r195141 r195304 30 30 #include "NodeList.h" 31 31 #include "SelectorCompiler.h" 32 #include <wtf/BumpArena.h>33 32 #include <wtf/HashMap.h> 34 33 #include <wtf/Vector.h> … … 134 133 135 134 public: 136 SelectorQueryCache();137 135 SelectorQuery* add(const String&, Document&, ExceptionCode&); 138 136 139 137 private: 140 138 HashMap<String, std::unique_ptr<SelectorQuery>> m_entries; 141 Ref<BumpArena> m_arena;142 139 }; 143 140 -
trunk/Source/WebCore/svg/SVGFontFaceElement.cpp
r195141 r195304 50 50 inline SVGFontFaceElement::SVGFontFaceElement(const QualifiedName& tagName, Document& document) 51 51 : SVGElement(tagName, document) 52 , m_fontFaceRule(StyleRuleFontFace::create( nullptr,MutableStyleProperties::create(CSSStrictMode)))52 , m_fontFaceRule(StyleRuleFontFace::create(MutableStyleProperties::create(CSSStrictMode))) 53 53 , m_fontElement(nullptr) 54 54 {
Note: See TracChangeset
for help on using the changeset viewer.