Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer std::abs over fabs #10699

Merged
merged 1 commit into from Mar 13, 2023
Merged

Conversation

AtariDreams
Copy link
Contributor

@AtariDreams AtariDreams commented Feb 26, 2023

da93445

Prefer std::abs over fabs
https://bugs.webkit.org/show_bug.cgi?id=252974

Reviewed by Ryosuke Niwa.

Unlike the C library versions, std::abs has overloads for every type, so one does not need to worry about which version of the function to call.

* Source/JavaScriptCore/assembler/MacroAssembler.h:
* Source/JavaScriptCore/b3/B3ConstDoubleValue.cpp:
* Source/JavaScriptCore/b3/B3ConstFloatValue.cpp:
* Source/JavaScriptCore/b3/testb3_3.cpp:
* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
* Source/JavaScriptCore/jit/AssemblyHelpersSpoolers.h:
* Source/JavaScriptCore/runtime/DateConversion.cpp:
* Source/JavaScriptCore/runtime/ISO8601.cpp:
* Source/JavaScriptCore/runtime/MathCommon.cpp:
* Source/JavaScriptCore/runtime/MathObject.cpp:
* Source/JavaScriptCore/runtime/NumberPrototype.cpp:
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
* Source/WTF/wtf/CurrentTime.cpp:
* Source/WTF/wtf/DateMath.cpp:
* Source/WTF/wtf/MediaTime.cpp:
* Source/WTF/wtf/text/TextStream.cpp:
* Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp:
* Source/WebCore/Modules/webaudio/AudioParam.cpp:
* Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp:
* Source/WebCore/Modules/webaudio/IIRFilterNode.cpp:
* Source/WebCore/Modules/webaudio/OscillatorNode.cpp:
* Source/WebCore/Modules/webaudio/PeriodicWave.cpp:
* Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
* Source/WebCore/bindings/js/JSDOMConvertNumbers.cpp:
* Source/WebCore/contentextensions/DFABytecodeCompiler.cpp:
* Source/WebCore/display/css/DisplayBoxDecorationPainter.cpp:
* Source/WebCore/editing/FrameSelection.cpp:
* Source/WebCore/editing/cocoa/HTMLConverter.mm:
* Source/WebCore/html/CustomPaintImage.cpp:
* Source/WebCore/html/HTMLMediaElement.cpp:
* Source/WebCore/inspector/InspectorOverlay.cpp:
* Source/WebCore/layout/Verification.cpp:
* Source/WebCore/page/EventHandler.cpp:
* Source/WebCore/page/Frame.cpp:
* Source/WebCore/page/WheelEventDeltaFilter.cpp:
* Source/WebCore/page/ios/FrameIOS.mm:
* Source/WebCore/platform/LayoutUnit.h:
* Source/WebCore/platform/LocalizedStrings.cpp:
* Source/WebCore/platform/ScrollAnimationKeyboard.cpp:
* Source/WebCore/platform/ScrollAnimationKinetic.cpp:
* Source/WebCore/platform/ScrollView.cpp:
* Source/WebCore/platform/audio/Biquad.cpp:
* Source/WebCore/platform/audio/Cone.cpp:
* Source/WebCore/platform/audio/DenormalDisabler.h:
* Source/WebCore/platform/audio/FFTFrame.cpp:
* Source/WebCore/platform/audio/HRTFPanner.cpp:
* Source/WebCore/platform/audio/IIRFilter.cpp:
* Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm:
* Source/WebCore/platform/graphics/FloatLine.cpp:
* Source/WebCore/platform/graphics/FloatSize.cpp:
* Source/WebCore/platform/graphics/GradientImage.cpp:
* Source/WebCore/platform/graphics/IntSize.h:
* Source/WebCore/platform/graphics/PathUtilities.cpp:
* Source/WebCore/platform/graphics/ShadowBlur.cpp:
* Source/WebCore/platform/graphics/UnitBezier.h:
* Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:
* Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
* Source/WebCore/platform/graphics/transforms/AffineTransform.cpp:
* Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:
* Source/WebCore/platform/graphics/win/FontCacheWin.cpp:
* Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
* Source/WebCore/platform/graphics/win/SystemFontDatabaseWin.cpp:
* Source/WebCore/platform/ios/ScrollAnimatorIOS.mm:
* Source/WebCore/platform/ios/WebAVPlayerController.mm:
* Source/WebCore/platform/ios/wak/WKView.mm:
* Source/WebCore/platform/mac/ScrollAnimationRubberBand.mm:
* Source/WebCore/platform/mac/ScrollingEffectsController.mm:
* Source/WebCore/platform/win/BitmapInfo.h:
* Source/WebCore/platform/win/PopupMenuWin.cpp:
* Source/WebCore/platform/xr/openxr/OpenXRUtils.h:
* Source/WebCore/rendering/AttachmentLayout.mm:
* Source/WebCore/rendering/BorderPainter.cpp:
* Source/WebCore/rendering/RenderLayerScrollableArea.cpp:
* Source/WebCore/rendering/RenderListBox.cpp:
* Source/WebCore/rendering/RenderMarquee.cpp:
* Source/WebCore/rendering/shapes/RasterShape.cpp:
* Source/WebCore/rendering/svg/SVGMarkerData.h:
* Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp:
* Source/WebCore/style/StyleBuilderConverter.h:
* Source/WebCore/style/StyleFontSizeFunctions.cpp:
* Source/WebCore/svg/SVGPathParser.cpp:
* Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
* Source/WebKit/UIProcess/gtk/KeyBindingTranslator.cpp:
* Source/WebKit/UIProcess/gtk/ViewGestureControllerGtk.cpp:
* Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:
* Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
* Source/WebKitLegacy/ios/WebCoreSupport/WebFrameIOS.mm:
* Source/WebKitLegacy/mac/WebView/WebDynamicScrollBarsView.mm:
* Tools/TestRunnerShared/EventSerialization/mac/EventSerializerMac.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
* Tools/TestWebKitAPI/Tests/ios/FullscreenTouchSecheuristicTests.cpp:
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

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

9982a47

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim   πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
  πŸ§ͺ api-ios   πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
βœ… πŸ›  πŸ§ͺ jsc βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2   πŸ§ͺ api-gtk
βœ… πŸ›  πŸ§ͺ jsc-arm64 βœ… πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ›  jsc-armv7
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress βœ… πŸ§ͺ jsc-armv7-tests
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim βœ… πŸ›  jsc-mips
βœ… πŸ§ͺ jsc-mips-tests

@rniwa
Copy link
Member

rniwa commented Feb 26, 2023

Please use Tools/Scripts/git-WebKit upload to create a PR after running Tools/Scripts/git-WebKit setup.

Your commit message must follow a certain format.

Copy link
Member

@rniwa rniwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message is in wrong format.

@AtariDreams
Copy link
Contributor Author

Commit message is in wrong format.

Will address.

@rniwa
Copy link
Member

rniwa commented Feb 28, 2023

Yes, I know fabs is not the only one with this issue, but if I made the changes for all std::math methods this PR would be too big and it is big enough as is.

This comment doesn't seem to add any value. Please remove it.

  • Source/JavaScriptCore/assembler/MacroAssembler.h:

There needs to be a list of each file being modified along with the list of functions being modified.

@AtariDreams AtariDreams removed the request for review from zdobersek February 28, 2023 15:40
Copy link
Member

@rniwa rniwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message needs to have a full list of files and functions like other commits.

@AtariDreams
Copy link
Contributor Author

Done!

@AtariDreams
Copy link
Contributor Author

All ready!

Copy link
Member

@rniwa rniwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

@Ahmad-S792 Ahmad-S792 added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Mar 1, 2023
@AtariDreams
Copy link
Contributor Author

Can we merge this please?

@rniwa rniwa added the merge-queue Applied to send a pull request to merge-queue label Mar 13, 2023
https://bugs.webkit.org/show_bug.cgi?id=252974

Reviewed by Ryosuke Niwa.

Unlike the C library versions, std::abs has overloads for every type, so one does not need to worry about which version of the function to call.

* Source/JavaScriptCore/assembler/MacroAssembler.h:
* Source/JavaScriptCore/b3/B3ConstDoubleValue.cpp:
* Source/JavaScriptCore/b3/B3ConstFloatValue.cpp:
* Source/JavaScriptCore/b3/testb3_3.cpp:
* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
* Source/JavaScriptCore/jit/AssemblyHelpersSpoolers.h:
* Source/JavaScriptCore/runtime/DateConversion.cpp:
* Source/JavaScriptCore/runtime/ISO8601.cpp:
* Source/JavaScriptCore/runtime/MathCommon.cpp:
* Source/JavaScriptCore/runtime/MathObject.cpp:
* Source/JavaScriptCore/runtime/NumberPrototype.cpp:
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
* Source/WTF/wtf/CurrentTime.cpp:
* Source/WTF/wtf/DateMath.cpp:
* Source/WTF/wtf/MediaTime.cpp:
* Source/WTF/wtf/text/TextStream.cpp:
* Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp:
* Source/WebCore/Modules/webaudio/AudioParam.cpp:
* Source/WebCore/Modules/webaudio/AudioParamTimeline.cpp:
* Source/WebCore/Modules/webaudio/IIRFilterNode.cpp:
* Source/WebCore/Modules/webaudio/OscillatorNode.cpp:
* Source/WebCore/Modules/webaudio/PeriodicWave.cpp:
* Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
* Source/WebCore/bindings/js/JSDOMConvertNumbers.cpp:
* Source/WebCore/contentextensions/DFABytecodeCompiler.cpp:
* Source/WebCore/display/css/DisplayBoxDecorationPainter.cpp:
* Source/WebCore/editing/FrameSelection.cpp:
* Source/WebCore/editing/cocoa/HTMLConverter.mm:
* Source/WebCore/html/CustomPaintImage.cpp:
* Source/WebCore/html/HTMLMediaElement.cpp:
* Source/WebCore/inspector/InspectorOverlay.cpp:
* Source/WebCore/layout/Verification.cpp:
* Source/WebCore/page/EventHandler.cpp:
* Source/WebCore/page/Frame.cpp:
* Source/WebCore/page/WheelEventDeltaFilter.cpp:
* Source/WebCore/page/ios/FrameIOS.mm:
* Source/WebCore/platform/LayoutUnit.h:
* Source/WebCore/platform/LocalizedStrings.cpp:
* Source/WebCore/platform/ScrollAnimationKeyboard.cpp:
* Source/WebCore/platform/ScrollAnimationKinetic.cpp:
* Source/WebCore/platform/ScrollView.cpp:
* Source/WebCore/platform/audio/Biquad.cpp:
* Source/WebCore/platform/audio/Cone.cpp:
* Source/WebCore/platform/audio/DenormalDisabler.h:
* Source/WebCore/platform/audio/FFTFrame.cpp:
* Source/WebCore/platform/audio/HRTFPanner.cpp:
* Source/WebCore/platform/audio/IIRFilter.cpp:
* Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm:
* Source/WebCore/platform/graphics/FloatLine.cpp:
* Source/WebCore/platform/graphics/FloatSize.cpp:
* Source/WebCore/platform/graphics/GradientImage.cpp:
* Source/WebCore/platform/graphics/IntSize.h:
* Source/WebCore/platform/graphics/PathUtilities.cpp:
* Source/WebCore/platform/graphics/ShadowBlur.cpp:
* Source/WebCore/platform/graphics/UnitBezier.h:
* Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:
* Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
* Source/WebCore/platform/graphics/transforms/AffineTransform.cpp:
* Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp:
* Source/WebCore/platform/graphics/win/FontCacheWin.cpp:
* Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
* Source/WebCore/platform/graphics/win/SystemFontDatabaseWin.cpp:
* Source/WebCore/platform/ios/ScrollAnimatorIOS.mm:
* Source/WebCore/platform/ios/WebAVPlayerController.mm:
* Source/WebCore/platform/ios/wak/WKView.mm:
* Source/WebCore/platform/mac/ScrollAnimationRubberBand.mm:
* Source/WebCore/platform/mac/ScrollingEffectsController.mm:
* Source/WebCore/platform/win/BitmapInfo.h:
* Source/WebCore/platform/win/PopupMenuWin.cpp:
* Source/WebCore/platform/xr/openxr/OpenXRUtils.h:
* Source/WebCore/rendering/AttachmentLayout.mm:
* Source/WebCore/rendering/BorderPainter.cpp:
* Source/WebCore/rendering/RenderLayerScrollableArea.cpp:
* Source/WebCore/rendering/RenderListBox.cpp:
* Source/WebCore/rendering/RenderMarquee.cpp:
* Source/WebCore/rendering/shapes/RasterShape.cpp:
* Source/WebCore/rendering/svg/SVGMarkerData.h:
* Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp:
* Source/WebCore/style/StyleBuilderConverter.h:
* Source/WebCore/style/StyleFontSizeFunctions.cpp:
* Source/WebCore/svg/SVGPathParser.cpp:
* Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
* Source/WebKit/UIProcess/gtk/KeyBindingTranslator.cpp:
* Source/WebKit/UIProcess/gtk/ViewGestureControllerGtk.cpp:
* Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:
* Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
* Source/WebKitLegacy/ios/WebCoreSupport/WebFrameIOS.mm:
* Source/WebKitLegacy/mac/WebView/WebDynamicScrollBarsView.mm:
* Tools/TestRunnerShared/EventSerialization/mac/EventSerializerMac.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
* Tools/TestWebKitAPI/Tests/ios/FullscreenTouchSecheuristicTests.cpp:
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

Canonical link: https://commits.webkit.org/261584@main
@webkit-commit-queue
Copy link
Collaborator

Committed 261584@main (da93445): https://commits.webkit.org/261584@main

Reviewed commits have been landed. Closing PR #10699 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 13, 2023
@webkit-commit-queue webkit-commit-queue merged commit da93445 into WebKit:main Mar 13, 2023
@AtariDreams AtariDreams deleted the double branch March 13, 2023 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Bugs Unclassified bugs are placed in this component until the correct component can be determined.
Projects
None yet
5 participants