Changeset 261651 in webkit
- Timestamp:
- May 13, 2020 1:49:24 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/ThirdParty/libwebrtc/ChangeLog
r261534 r261651 1 2020-05-13 Jer Noble <jer.noble@apple.com> 2 3 Replace isNullFunctionPointer with real weak-linking support 4 https://bugs.webkit.org/show_bug.cgi?id=211751 5 6 Reviewed by Sam Weinig. 7 8 * Source/webrtc/sdk/WebKit/WebKitUtilities.h: 9 1 10 2020-05-11 Saam Barati <sbarati@apple.com> 2 11 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.h
r260129 r261651 45 45 std::unique_ptr<webrtc::VideoDecoderFactory> createWebKitDecoderFactory(WebKitCodecSupport); 46 46 47 void setApplicationStatus(bool isActive) __attribute__((weak_import));47 void setApplicationStatus(bool isActive); 48 48 49 49 void setH264HardwareEncoderAllowed(bool); -
trunk/Source/WTF/ChangeLog
r261598 r261651 1 2020-05-13 Jer Noble <jer.noble@apple.com> 2 3 Replace isNullFunctionPointer with real weak-linking support 4 https://bugs.webkit.org/show_bug.cgi?id=211751 5 6 Reviewed by Sam Weinig. 7 8 Replace isNullFunctionPointer with a macro which explicitly marks symbols as weakly imported. 9 10 * wtf/darwin/WeakLinking.h: 11 (WTF::isNullFunctionPointer): Deleted. 12 1 13 2020-05-12 Mark Lam <mark.lam@apple.com> 2 14 -
trunk/Source/WTF/wtf/darwin/WeakLinking.h
r225552 r261651 26 26 #pragma once 27 27 28 #include <type_traits> 29 30 namespace WTF { 31 32 template<typename T, typename = std::enable_if_t<std::is_function<T>::value>> 33 inline bool isNullFunctionPointer(T* functionPointer) 34 { 35 void* result; 36 // The C compiler may take advantage of the fact that by definition, function pointers cannot be 37 // null. When weak-linking a library, function pointers can be null. We use non-C code to 38 // prevent the C compiler from using the definition to optimize out the null check. 39 asm( 40 #if CPU(ARM64) && defined(__ILP32__) 41 "mov %w1, %w0" 42 #else 43 "mov %1, %0" 44 #endif 45 : "=r" (result) 46 : "r" (functionPointer) 47 ); 48 return !result; 49 } 50 51 } 52 53 using WTF::isNullFunctionPointer; 28 #define WTF_WEAK_LINK_FORCE_IMPORT(sym) extern __attribute__((weak_import)) __typeof__(sym) sym -
trunk/Source/WebCore/ChangeLog
r261644 r261651 1 2020-05-13 Jer Noble <jer.noble@apple.com> 2 3 Replace isNullFunctionPointer with real weak-linking support 4 https://bugs.webkit.org/show_bug.cgi?id=211751 5 6 Reviewed by Sam Weinig. 7 8 Use the new WTF_WEAK_LINK_FORCE_IMPORT macro. 9 10 * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: 11 (WebCore::LibWebRTCProvider::webRTCAvailable): 12 1 13 2020-05-13 Andres Gonzalez <andresg_22@apple.com> 2 14 -
trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp
r260129 r261651 34 34 #include <wtf/MainThread.h> 35 35 #include <wtf/darwin/WeakLinking.h> 36 37 WTF_WEAK_LINK_FORCE_IMPORT(webrtc::setApplicationStatus); 36 38 37 39 namespace WebCore { … … 77 79 return true; 78 80 #else 79 return ! isNullFunctionPointer(webrtc::setApplicationStatus);81 return !!webrtc::setApplicationStatus; 80 82 #endif 81 83 } -
trunk/Source/WebKit/ChangeLog
r261640 r261651 1 2020-05-13 Jer Noble <jer.noble@apple.com> 2 3 Replace isNullFunctionPointer with real weak-linking support 4 https://bugs.webkit.org/show_bug.cgi?id=211751 5 6 Reviewed by Sam Weinig. 7 8 Use the new WTF_WEAK_LINK_FORCE_IMPORT macro. 9 10 * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: 11 (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): 12 1 13 2020-05-13 Tim Horton <timothy_horton@apple.com> 2 14 -
trunk/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp
r242406 r261651 33 33 #include <wtf/NeverDestroyed.h> 34 34 #include <wtf/darwin/WeakLinking.h> 35 36 WTF_WEAK_LINK_FORCE_IMPORT(svm_load_model); 35 37 36 38 namespace WebKit { … … 82 84 return false; 83 85 84 if ( isNullFunctionPointer(svm_load_model)) {86 if (svm_load_model) { 85 87 m_useCorePrediction = false; 86 88 return false; -
trunk/Tools/ChangeLog
r261640 r261651 1 2020-05-13 Jer Noble <jer.noble@apple.com> 2 3 Replace isNullFunctionPointer with real weak-linking support 4 https://bugs.webkit.org/show_bug.cgi?id=211751 5 6 Reviewed by Sam Weinig. 7 8 * TestWebKitAPI/Tests/WTF/darwin/WeakLinking.cpp: 9 (TestWebKitAPI::TEST): 10 * TestWebKitAPI/Tests/WTF/darwin/libTestWTFAlwaysMissing-iOS-v2.tbd: 11 * TestWebKitAPI/Tests/WTF/darwin/libTestWTFAlwaysMissing-iOS.tbd: 12 * TestWebKitAPI/Tests/WTF/darwin/libTestWTFAlwaysMissing-macOS-v2.tbd: 13 * TestWebKitAPI/Tests/WTF/darwin/libTestWTFAlwaysMissing-macOS.tbd: 14 1 15 2020-05-13 Tim Horton <timothy_horton@apple.com> 2 16 -
trunk/Tools/TestWebKitAPI/Tests/WTF/darwin/WeakLinking.cpp
r237607 r261651 43 43 extern "C" { 44 44 extern void TestWTFAlwaysMissing(void) __attribute__((weak_import)); 45 extern void TestWTFAlwaysMissingWithoutAttributeWeakImport(void); 45 46 } 47 48 WTF_WEAK_LINK_FORCE_IMPORT(TestWTFAlwaysMissingWithoutAttributeWeakImport); 49 WTF_WEAK_LINK_FORCE_IMPORT(close); 46 50 47 51 namespace TestWebKitAPI { 48 52 49 TEST(WeakLinking, IsNullFunctionPointer)53 TEST(WeakLinking, WeakImport) 50 54 { 51 EXPECT_TRUE(isNullFunctionPointer(TestWTFAlwaysMissing)); 52 EXPECT_FALSE(isNullFunctionPointer(close)); 55 EXPECT_FALSE(TestWTFAlwaysMissing); 56 EXPECT_FALSE(TestWTFAlwaysMissingWithoutAttributeWeakImport); 57 EXPECT_TRUE(close); 53 58 } 54 59 -
trunk/Tools/TestWebKitAPI/Tests/WTF/darwin/libTestWTFAlwaysMissing-iOS-v2.tbd
r225552 r261651 7 7 exports: 8 8 - archs: [ i386, x86_64, armv7, armv7s, arm64, arm64_32 ] 9 symbols: [ _TestWTFAlwaysMissing ]9 symbols: [ _TestWTFAlwaysMissing, _TestWTFAlwaysMissingWithoutAttributeWeakImport ] 10 10 ... -
trunk/Tools/TestWebKitAPI/Tests/WTF/darwin/libTestWTFAlwaysMissing-iOS.tbd
r215424 r261651 6 6 exports: 7 7 - archs: [ i386, x86_64, armv7, armv7s, arm64 ] 8 symbols: [ _TestWTFAlwaysMissing ]8 symbols: [ _TestWTFAlwaysMissing, _TestWTFAlwaysMissingWithoutAttributeWeakImport ] 9 9 ... -
trunk/Tools/TestWebKitAPI/Tests/WTF/darwin/libTestWTFAlwaysMissing-macOS-v2.tbd
r215424 r261651 7 7 exports: 8 8 - archs: [ i386, x86_64 ] 9 symbols: [ _TestWTFAlwaysMissing ]9 symbols: [ _TestWTFAlwaysMissing, _TestWTFAlwaysMissingWithoutAttributeWeakImport ] 10 10 ... -
trunk/Tools/TestWebKitAPI/Tests/WTF/darwin/libTestWTFAlwaysMissing-macOS.tbd
r215424 r261651 6 6 exports: 7 7 - archs: [ i386, x86_64 ] 8 symbols: [ _TestWTFAlwaysMissing ]8 symbols: [ _TestWTFAlwaysMissing, _TestWTFAlwaysMissingWithoutAttributeWeakImport ] 9 9 ...
Note: See TracChangeset
for help on using the changeset viewer.