[webkit-changes] [WebKit/WebKit] 79e81a: [ARM] Add release build type check to downcast<T>()

Chris Dumez noreply at github.com
Tue Dec 19 13:42:13 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 79e81a318c92f39fccf9f61711d49a7ba5525413
      https://github.com/WebKit/WebKit/commit/79e81a318c92f39fccf9f61711d49a7ba5525413
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-12-19 (Tue, 19 Dec 2023)

  Changed paths:
    M Source/WTF/wtf/Ref.h
    M Source/WTF/wtf/RefPtr.h
    M Source/WTF/wtf/TypeCasts.h
    M Source/WTF/wtf/WeakPtr.h
    M Source/WTF/wtf/WeakRef.h
    M Source/WebCore/bindings/js/JSNodeCustom.cpp
    M Source/WebCore/css/BasicShapeFunctions.cpp
    M Source/WebCore/css/CSSValue.cpp
    M Source/WebCore/css/ComputedStyleExtractor.cpp
    M Source/WebCore/css/StyleRule.cpp
    M Source/WebCore/css/StyleSheetContents.cpp
    M Source/WebCore/css/calc/CSSCalcValue.cpp
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/ElementData.cpp
    M Source/WebCore/dom/ElementData.h
    M Source/WebCore/dom/Node.cpp
    M Source/WebCore/style/StyleScope.cpp

  Log Message:
  -----------
  [ARM] Add release build type check to downcast<T>()
https://bugs.webkit.org/show_bug.cgi?id=266588

Reviewed by Brent Fulgham and Ryosuke Niwa.

Add release build type check to downcast<T>() on ARM, where this tested as
performance neutral. Some more work will be needed to make it affordable on
Intel.

This patch introduces an uncheckedDowncast<>() which only does the type check
on debug builds (like downcast<>() used to do). It is useful for cases where
it is clear the code is safe (e.g. in a switch statement for the type),
especially in hot code.

This patch also converts some more `is<>() + downcast<>()` calls with
`dynamicDowncast<>()`, which is now more efficient.

* Source/WTF/wtf/Ref.h:
(WTF::uncheckedDowncast):
(WTF::downcast):
* Source/WTF/wtf/RefPtr.h:
(WTF::uncheckedDowncast):
(WTF::downcast):
* Source/WTF/wtf/TypeCasts.h:
(WTF::uncheckedDowncast):
(WTF::downcast):
* Source/WTF/wtf/WeakPtr.h:
(WTF::downcast):
* Source/WTF/wtf/WeakRef.h:
(WTF::downcast):
* Source/WebCore/animation/AcceleratedTimeline.cpp:
(WebCore::AcceleratedTimeline::updateEffectStacks):
* Source/WebCore/animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::bindingsUpdateTiming):
(WebCore::AnimationEffect::progressUntilNextStep const):
* Source/WebCore/animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationTimingDidChange):
* Source/WebCore/animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::keyframesRuleDidChange):
(WebCore::CSSAnimation::updateKeyframesIfNeeded):
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
* Source/WebCore/animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::animationCanBeRemoved):
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getKeyframes):
(WebCore::KeyframeEffect::setBindingsKeyframes):
(WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes):
(WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
(WebCore::isLinearTimingFunctionWithPoints):
(WebCore::KeyframeEffect::computeSomeKeyframesUseStepsOrLinearTimingFunctionWithPoints):
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
(WebCore::KeyframeEffect::progressUntilNextStep const):
(WebCore::KeyframeEffect::timingFunctionForKeyframe const):
* Source/WebCore/animation/ViewTimeline.cpp:
(WebCore::ViewTimeline::createFromCSSValue):
* Source/WebCore/animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffectInternal):
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::acceleratedStateDidChange):
(WebCore::WebAnimation::updateRelevance):
(WebCore::WebAnimation::isReplaceable const):
(WebCore::WebAnimation::commitStyles):
* Source/WebCore/animation/WebAnimationUtilities.cpp:
(WebCore::compareAnimationsByCompositeOrder):
(WebCore::compareDeclarativeAnimationEvents):
* Source/WebCore/bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
* Source/WebCore/css/BasicShapeFunctions.cpp:
(WebCore::valueForBasicShape):
* Source/WebCore/css/CSSValue.cpp:
(WebCore::CSSValue::visitDerived):
(WebCore::CSSValue::createDeprecatedCSSOMWrapper const):
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::valueForAnimationTimingFunction):
(WebCore::valueForPathOperation):
* Source/WebCore/css/StyleRule.cpp:
(WebCore::StyleRuleBase::visitDerived):
* Source/WebCore/css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::traverseSubresources const):
* Source/WebCore/css/TransformFunctions.cpp:
(WebCore::transformForValue):
* Source/WebCore/css/calc/CSSCalcValue.cpp:
(WebCore::createCSS):
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeFontFeatureValuesRule):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::importNode):
(WebCore::Document::adoptNode):
(WebCore::Document::canAcceptChild const):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::createUniqueElementData):
* Source/WebCore/dom/ElementData.cpp:
(WebCore::ElementData::destroy):
* Source/WebCore/dom/ElementData.h:
(WebCore::ElementData::attributeBase const):
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::dumpStatistics):
(WebCore::Node::normalize):
(WebCore::Node::isEqualNode const):
(WebCore::locateDefaultNamespace):
(WebCore::Node::lookupPrefix const):
(WebCore::appendTextContent):
(WebCore::Node::setTextContent):
(WebCore::Node::showNodePathForThis const):
* Source/WebCore/style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyProperty):
(WebCore::Style::Builder::resolveVariableReferences):
* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertTextDecorationLine):
(WebCore::Style::BuilderConverter::convertTextTransform):
(WebCore::Style::BuilderConverter::convertColorScheme):
(WebCore::Style::BuilderConverter::convertTextEmphasisPosition):
(WebCore::Style::BuilderConverter::convertPathOperation):
(WebCore::Style::BuilderConverter::convertQuotes):
(WebCore::Style::BuilderConverter::convertShapeValue):
(WebCore::Style::BuilderConverter::convertScrollbarGutter):
(WebCore::Style::BuilderConverter::createGridTrackSize):
(WebCore::Style::BuilderConverter::createGridTrackList):
(WebCore::Style::BuilderConverter::createGridPosition):
(WebCore::Style::BuilderConverter::convertGridTrackSizeList):
(WebCore::Style::BuilderConverter::convertGridAutoFlow):
(WebCore::Style::BuilderConverter::convertFontSizeAdjust):
(WebCore::Style::BuilderConverter::convertTouchAction):
(WebCore::Style::BuilderConverter::convertContentAlignmentData):
(WebCore::Style::BuilderConverter::convertSpeakAs):
(WebCore::Style::BuilderConverter::convertHangingPunctuation):
(WebCore::Style::BuilderConverter::convertContainerName):
(WebCore::Style::BuilderConverter::convertViewTransitionName):
(WebCore::Style::BuilderConverter::convertWillChange):
(WebCore::Style::BuilderConverter::convertScrollTimelineName):
(WebCore::Style::BuilderConverter::convertScrollTimelineAxis):
(WebCore::Style::BuilderConverter::convertViewTimelineInset):
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueSize):
(WebCore::Style::maybeUpdateFontForLetterSpacing):
(WebCore::Style::BuilderCustom::applyValueAspectRatio):
(WebCore::Style::BuilderCustom::applyValueTextEmphasisStyle):
(WebCore::Style::BuilderCustom::applyValueCursor):
(WebCore::Style::BuilderCustom::applyValueFill):
(WebCore::Style::BuilderCustom::applyValueStroke):
(WebCore::Style::BuilderCustom::applyValueContent):
(WebCore::Style::BuilderCustom::applyValueContainIntrinsicWidth):
(WebCore::Style::BuilderCustom::applyValueContainIntrinsicHeight):
* Source/WebCore/style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::createStyleImage):
* Source/WebCore/style/StyleInvalidator.cpp:
(WebCore::Style::shouldDirtyAllStyle):
(WebCore::Style::invalidateAssignedElements):
(WebCore::Style::Invalidator::invalidateIfNeeded):
* Source/WebCore/style/StylePendingResources.cpp:
(WebCore::Style::loadPendingResources):
* Source/WebCore/style/StyleResolveForFontRaw.cpp:
(WebCore::Style::resolveForFontRaw):
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::styleForKeyframe):
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::releaseMemory):
(WebCore::Style::Scope::collectXSLTransforms):
(WebCore::Style::Scope::collectActiveStyleSheets):
(WebCore::Style::filterEnabledNonemptyCSSStyleSheets):
(WebCore::Style::Scope::activeStyleSheetsForInspector):
* Source/WebCore/style/StyleSharingResolver.cpp:
(WebCore::Style::elementHasDirectionAuto):
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::findSibling const):
(WebCore::Style::SharingResolver::canShareStyleWithElement const):
* Source/WebCore/style/Styleable.cpp:
(WebCore::Styleable::fromRenderer):
(WebCore::Styleable::renderer const):
(WebCore::updateCSSTransitionsForStyleableAndProperty):
* Source/WebCore/style/Styleable.h:
(WebCore::Styleable::fromElement):
* Source/WebCore/svg/SVGAnimateElementBase.h:
(isType):
* Source/WebCore/svg/SVGComponentTransferFunctionElementInlines.h:
(isType):
* Source/WebCore/svg/SVGDocument.h:
(isType):
* Source/WebCore/svg/SVGElementInlines.h:
(WebCore::Node::hasTagName const):
* Source/WebCore/svg/SVGGeometryElement.h:
(isType):
* Source/WebCore/svg/SVGGradientElement.h:
(isType):
* Source/WebCore/svg/SVGGraphicsElement.h:
(isType):
* Source/WebCore/svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::computeViewportSize const):
* Source/WebCore/svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::toCSSPrimitiveValue const):
* Source/WebCore/svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* Source/WebCore/svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::computeCTM):
(WebCore::SVGLocatable::getTransformToElement):
* Source/WebCore/svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource):
(WebCore::SVGMPathElement::pathElement):
(WebCore::SVGMPathElement::notifyParentOfPathChange):
* Source/WebCore/svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::invalidateMPathDependencies):
* Source/WebCore/svg/SVGPolyElement.h:
(isType):
* Source/WebCore/svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* Source/WebCore/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::localCoordinateSpaceTransform const):
* Source/WebCore/svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::elementFromRenderer):
* Source/WebCore/svg/SVGTextContentElement.h:
(isType):
* Source/WebCore/svg/SVGUseElement.cpp:
(WebCore::isDisallowedElement):
(WebCore::SVGUseElement::toClipPath):
(WebCore::disassociateAndRemoveClones):
(WebCore::SVGUseElement::findTarget const):
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
(WebCore::SVGSMILElement::connectConditions):
* Source/WebCore/svg/animation/SVGSMILElement.h:
(isType):
* Source/WebCore/svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::renderingTaintsOrigin const):
* Source/WebCore/svg/properties/SVGPropertyAnimator.h:
(WebCore::SVGPropertyAnimator::computeInheritedCSSPropertyValue const):

Canonical link: https://commits.webkit.org/272296@main




More information about the webkit-changes mailing list