[webkit-changes] [WebKit/WebKit] a10d22: [WTF] Prepare for InstallAPI by hiding project hea...
Elliott Williams
noreply at github.com
Thu Apr 6 10:41:42 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a10d22f7b1fb715a33f3c1293c49916497e34bb3
https://github.com/WebKit/WebKit/commit/a10d22f7b1fb715a33f3c1293c49916497e34bb3
Author: Elliott Williams <emw at apple.com>
Date: 2023-04-06 (Thu, 06 Apr 2023)
Changed paths:
M Source/JavaScriptCore/runtime/Options.cpp
M Source/JavaScriptCore/tools/Integrity.cpp
M Source/WTF/WTF.xcodeproj/project.pbxproj
M Source/WTF/wtf/AutodrainedPool.h
M Source/WTF/wtf/CMakeLists.txt
M Source/WTF/wtf/FastFloat.cpp
M Source/WTF/wtf/MemoryPressureHandler.cpp
M Source/WTF/wtf/MemoryPressureHandler.h
R Source/WTF/wtf/OSLogPrintStream.cpp
R Source/WTF/wtf/OSLogPrintStream.h
M Source/WTF/wtf/SingleRootGraph.h
M Source/WTF/wtf/Threading.cpp
M Source/WTF/wtf/WallTime.h
M Source/WTF/wtf/WorkQueue.h
A Source/WTF/wtf/darwin/OSLogPrintStream.h
A Source/WTF/wtf/darwin/OSLogPrintStream.mm
M Source/WTF/wtf/fast_float/ascii_number.h
M Source/WTF/wtf/fast_float/bigint.h
M Source/WTF/wtf/fast_float/decimal_to_binary.h
M Source/WTF/wtf/fast_float/digit_comparison.h
M Source/WTF/wtf/fast_float/fast_float.h
M Source/WTF/wtf/fast_float/parse_number.h
M Source/WTF/wtf/fast_float/simple_decimal_conversion.h
M Source/WTF/wtf/ios/WebCoreThread.h
M Source/WTF/wtf/text/WTFString.h
Log Message:
-----------
[WTF] Prepare for InstallAPI by hiding project headers and fixing inconsistencies
https://bugs.webkit.org/show_bug.cgi?id=254614
rdar://107332243
Reviewed by Alexey Proskuryakov.
As part of the larger project of JavaScriptCore InstallAPI on Apple
platforms, we need to prepare WTF's headers to be parsable by TAPI.
Make small non-functional changes to headers which fix symbol visibility
inconsistences, hide headers not used by clients, and generally make the
headers parsable by TAPI.
* Source/WTF/WTF.xcodeproj/project.pbxproj: Stop installing some headers
to /usr/local/include/wtf which are only used for compiling WTF. This
avoids some TAPI issues, especially with headers that are not valid
Objective-C++ and therefore arguably never belonged in WTF's private
header set.
* Source/WTF/wtf/AutodrainedPool.h: Allow TAPI to parse this even though
it uses an Objective-C frontend.
* Source/WTF/wtf/SingleRootGraph.h: Add missing include.
* Source/WTF/wtf/Threading.cpp:
(WTF::initializeThreading): Deleted, was a compatibility hack to support
Safari from many years ago.
* Source/WTF/wtf/WallTime.h: Remove unimplemented sleep() declaration.
* Source/WTF/wtf/WorkQueue.h: Remove unimplemented assertIsCurrent()
declaration.
* Source/WTF/wtf/ios/WebCoreThread.h: Add the same #if guard on these
declarations that is used in WebCoreThread.cpp.
* Source/WTF/wtf/text/WTFString.h: Remove unimplemented
numberToStringFixedWidth() declaration.
Of the headers no longer being installed, fast_float headers need
updating to use quote-style impots. This is actually how they are
imported upstream.
* Source/WTF/wtf/FastFloat.cpp: Use quote-imports.
* Source/WTF/wtf/fast_float/ascii_number.h: Ditto.
* Source/WTF/wtf/fast_float/bigint.h: Ditto.
* Source/WTF/wtf/fast_float/decimal_to_binary.h: Ditto.
* Source/WTF/wtf/fast_float/digit_comparison.h: Ditto.
* Source/WTF/wtf/fast_float/fast_float.h: Ditto.
* Source/WTF/wtf/fast_float/parse_number.h: Ditto.
* Source/WTF/wtf/fast_float/simple_decimal_conversion.h: Ditto.
Fix symbol inconsistencies related to use of OS objects, which are
declared as opaque NSObjects when using an Objective-C compiler, and are
otherwise C struct typedefs. When WTF's implementation of an OS object
function is in C++, the mangled symbol name does not match the
declaration an Objective-C++ compiler sees. This means that these
interfaces were never callable from Objective-C++. There are two such
inconsistencies detected by TAPI.
1. OSLogPrintStream, which uses os_log_type_t. Since this class is only
applicable to Darwin-based platforms, change its implementation to
Objective-C++ and move it to wtf/darwin/.
* Source/JavaScriptCore/runtime/Options.cpp: Update include directive.
* Source/JavaScriptCore/tools/Integrity.cpp: Update include directive.
* Source/WTF/wtf/CMakeLists.txt: Remove OSLogPrintStream from headers
and sources, since they do nothing on non-Apple platforms.
* Source/WTF/wtf/darwin/OSLogPrintStream.h: Renamed from Source/WTF/wtf/OSLogPrintStream.h.
* Source/WTF/wtf/darwin/OSLogPrintStream.mm: Renamed from Source/WTF/wtf/OSLogPrintStream.cpp.
2. MemoryPressureHandler::setDispatchQueue, which uses dispatch_queue_t.
While it is obviously Darwin-only, setDispatchQueue is called by C++
cross-platform C++ code (jsc.cpp), so moving the implementation to a
.mm file breaks this use site. Instead, since it's just a single
assignment, make it an inline function.
* Source/WTF/wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::setDispatchQueue): Deleted.
* Source/WTF/wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::setDispatchQueue):
Canonical link: https://commits.webkit.org/262668@main
More information about the webkit-changes
mailing list