Changeset 96192 in webkit
- Timestamp:
- Sep 27, 2011 11:32:38 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96187 r96192 1 2011-09-27 Luke Macpherson <macpherson@chromium.org> 2 3 Defer call to CSSValue::isPrimitiveValue(), saves ~4% in CSSStyleSelector::applyProperty(). 4 https://bugs.webkit.org/show_bug.cgi?id=68964 5 6 Reviewed by Eric Seidel. 7 8 No new tests / no functionality changed. 9 10 Doing value->isPrimitiveValue() is relatviely expensive, so moving it after the early returns but 11 before the result is used saves a significant number of cycles. (Tested with Shark profiler in Safari). 12 13 * css/CSSStyleSelector.cpp: 14 (WebCore::CSSStyleSelector::applyProperty): 15 1 16 2011-09-27 Ryosuke Niwa <rniwa@webkit.org> 2 17 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r96168 r96192 2349 2349 void CSSStyleSelector::applyProperty(int id, CSSValue *value) 2350 2350 { 2351 CSSPrimitiveValue* primitiveValue = 0;2352 if (value->isPrimitiveValue())2353 primitiveValue = static_cast<CSSPrimitiveValue*>(value);2354 2355 float zoomFactor = m_style->effectiveZoom();2356 2357 2351 Length l; 2358 2352 … … 2361 2355 bool isInherit = m_parentNode && valueType == CSSValue::CSS_INHERIT; 2362 2356 bool isInitial = valueType == CSSValue::CSS_INITIAL || (!m_parentNode && valueType == CSSValue::CSS_INHERIT); 2363 2357 2364 2358 id = CSSProperty::resolveDirectionAwareProperty(id, m_style->direction(), m_style->writingMode()); 2365 2359 … … 2368 2362 return; 2369 2363 } 2370 2364 2371 2365 CSSPropertyID property = static_cast<CSSPropertyID>(id); 2372 2366 … … 2382 2376 } 2383 2377 2378 CSSPrimitiveValue* primitiveValue = value->isPrimitiveValue() ? static_cast<CSSPrimitiveValue*>(value) : 0; 2379 2380 float zoomFactor = m_style->effectiveZoom(); 2381 2384 2382 // What follows is a list that maps the CSS properties into their corresponding front-end 2385 2383 // RenderStyle values. Shorthands (e.g. border, background) occur in this list as well and
Note: See TracChangeset
for help on using the changeset viewer.