Rename initializeThreading to initialize
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 28 Jun 2020 20:55:08 +0000 (20:55 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 28 Jun 2020 20:55:08 +0000 (20:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=213674

Reviewed by Mark Lam.

Source/JavaScriptCore:

* API/JSClassRef.cpp:
* API/JSContextRef.cpp:
(JSContextGroupCreate):
(JSGlobalContextCreate):
(JSGlobalContextCreateInGroup):
* API/JSObjectRef.cpp:
(JSClassCreate):
* API/JSStringRef.cpp:
(JSStringCreateWithCharacters):
(JSStringCreateWithUTF8CString):
(JSStringCreateWithCharactersNoCopy):
* API/JSStringRefCF.cpp:
(JSStringCreateWithCFString):
* API/tests/CompareAndSwapTest.cpp:
(testCompareAndSwap):
* API/tests/ExecutionTimeLimitTest.cpp:
(testExecutionTimeLimit):
* API/tests/FunctionOverridesTest.cpp:
(testFunctionOverrides):
* API/tests/MultithreadedMultiVMExecutionTest.cpp:
(startMultithreadedMultiVMExecutionTest):
* API/tests/PingPongStackOverflowTest.cpp:
(testPingPongStackOverflow):
* JavaScriptCore.order:
* assembler/testmasm.cpp:
(JSC::run):
* b3/air/testair.cpp:
(main):
* b3/testb3_1.cpp:
(main):
* dfg/testdfg.cpp:
(main):
* dynbench.cpp:
(main):
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::singleton):
* jsc.cpp:
(main):
(jscmain):
* runtime/InitializeThreading.cpp:
(JSC::initialize):
(JSC::initializeThreading): Deleted.
* runtime/InitializeThreading.h:
* runtime/JSCConfig.h:
* shell/playstation/TestShell.cpp:
(setupTestRun):
* testRegExp.cpp:
(main):

Source/WebCore:

* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::openDatabase):
* WebCore.order:
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initializeMainThread):
(WebCore::ScriptController::initializeThreading): Deleted.
* bindings/js/ScriptController.h:
* bridge/objc/WebScriptObject.mm:
(+[WebScriptObject initialize]):
* platform/cocoa/SharedBufferCocoa.mm:
(+[WebCoreSharedBufferData initialize]):
* platform/ios/wak/WebCoreThread.mm:
(RunWebThread):

Source/WebKit:

* Shared/API/c/WKString.cpp:
(WKStringCopyJSString):
* Shared/Cocoa/WebKit2InitializeCocoa.mm:
(WebKit::runInitializationCode):
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):

Source/WebKitLegacy/mac:

* History/WebBackForwardList.mm:
(+[WebBackForwardList initialize]):
* History/WebHistoryItem.mm:
(+[WebHistoryItem initialize]):
* Misc/WebCache.mm:
(+[WebCache initialize]):
* Misc/WebElementDictionary.mm:
(+[WebElementDictionary initialize]):
* Misc/WebIconDatabase.mm:
* Misc/WebStringTruncator.mm:
(+[WebStringTruncator initialize]):
* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(+[WebHostedNetscapePluginView initialize]):
* Plugins/WebBaseNetscapePluginView.mm:
* Plugins/WebBasePluginPackage.mm:
(+[WebBasePluginPackage initialize]):
* Plugins/WebNetscapePluginView.mm:
(+[WebNetscapePluginView initialize]):
* WebCoreSupport/WebEditorClient.mm:
(+[WebUndoStep initialize]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(+[WebFramePolicyListener initialize]):
* WebView/WebArchive.mm:
(+[WebArchivePrivate initialize]):
* WebView/WebDataSource.mm:
(+[WebDataSource initialize]):
* WebView/WebHTMLView.mm:
(+[WebHTMLViewPrivate initialize]):
(+[WebHTMLView initialize]):
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebResource.mm:
(+[WebResourcePrivate initialize]):
* WebView/WebTextIterator.mm:
(+[WebTextIteratorPrivate initialize]):
* WebView/WebView.mm:
(+[WebView initialize]):
* WebView/WebViewData.mm:
(+[WebViewPrivate initialize]):

Source/WebKitLegacy/win:

* WebKitClassFactory.cpp:
(WebKitClassFactory::WebKitClassFactory):
* WebView.cpp:
(WebView::WebView):

Source/WTF:

Reasons:

(1) You need to call it even if you don't use threads.

(2) It initializes things unrelated to threads (like the PRNG).

(3) People seem to get confused about the relationship between
initializeThreading() and initializeMainThread(), and sometimes think
initializeThreading() is a superset. The opposite is true! I think the
confusion may come from "threading" being read as "all threading".

Some filenames still use the legacy name. We can fix that in post.

* benchmarks/ConditionSpeedTest.cpp:
(main):
* benchmarks/HashSetDFGReplay.cpp:
(main):
* benchmarks/LockFairnessTest.cpp:
(main):
* benchmarks/LockSpeedTest.cpp:
(main):
* wtf/MainThread.cpp:
(WTF::initializeMainThread):
* wtf/Threading.cpp:
(WTF::Thread::create):
(WTF::initialize):
(WTF::initializeThreading): Deleted.
* wtf/Threading.h:
(WTF::Thread::current):

Tools:

* TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp:
(ApplicationManifestParserTest::SetUp):
* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::ComplexTextControllerTest::SetUp):
* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::ContentExtensionTest::SetUp):
* TestWebKitAPI/Tests/WebCore/StringUtilities.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm:
(TestWebKitAPI::WebCoreNSURLSessionTest::SetUp):
* TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp:
(WebKitTestServer::WebKitTestServer):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263635 268f45cc-cd09-0410-ab3c-d52691b4dbfc

77 files changed:
Source/JavaScriptCore/API/JSClassRef.cpp
Source/JavaScriptCore/API/JSContextRef.cpp
Source/JavaScriptCore/API/JSObjectRef.cpp
Source/JavaScriptCore/API/JSStringRef.cpp
Source/JavaScriptCore/API/JSStringRefCF.cpp
Source/JavaScriptCore/API/tests/CompareAndSwapTest.cpp
Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp
Source/JavaScriptCore/API/tests/FunctionOverridesTest.cpp
Source/JavaScriptCore/API/tests/MultithreadedMultiVMExecutionTest.cpp
Source/JavaScriptCore/API/tests/PingPongStackOverflowTest.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.order
Source/JavaScriptCore/assembler/testmasm.cpp
Source/JavaScriptCore/b3/air/testair.cpp
Source/JavaScriptCore/b3/testb3_1.cpp
Source/JavaScriptCore/dfg/testdfg.cpp
Source/JavaScriptCore/dynbench.cpp
Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/InitializeThreading.cpp
Source/JavaScriptCore/runtime/InitializeThreading.h
Source/JavaScriptCore/runtime/JSCConfig.h
Source/JavaScriptCore/shell/playstation/TestShell.cpp
Source/JavaScriptCore/testRegExp.cpp
Source/WTF/ChangeLog
Source/WTF/benchmarks/ConditionSpeedTest.cpp
Source/WTF/benchmarks/HashSetDFGReplay.cpp
Source/WTF/benchmarks/LockFairnessTest.cpp
Source/WTF/benchmarks/LockSpeedTest.cpp
Source/WTF/wtf/MainThread.cpp
Source/WTF/wtf/Threading.cpp
Source/WTF/wtf/Threading.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/webdatabase/DatabaseManager.cpp
Source/WebCore/WebCore.order
Source/WebCore/bindings/js/CommonVM.cpp
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/ScriptController.h
Source/WebCore/bridge/objc/WebScriptObject.mm
Source/WebCore/platform/cocoa/SharedBufferCocoa.mm
Source/WebCore/platform/ios/wak/WebCoreThread.mm
Source/WebKit/ChangeLog
Source/WebKit/Shared/API/c/WKString.cpp
Source/WebKit/Shared/Cocoa/WebKit2InitializeCocoa.mm
Source/WebKit/Shared/WebKit2Initialize.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/History/WebBackForwardList.mm
Source/WebKitLegacy/mac/History/WebHistoryItem.mm
Source/WebKitLegacy/mac/Misc/WebCache.mm
Source/WebKitLegacy/mac/Misc/WebElementDictionary.mm
Source/WebKitLegacy/mac/Misc/WebIconDatabase.mm
Source/WebKitLegacy/mac/Misc/WebStringTruncator.mm
Source/WebKitLegacy/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
Source/WebKitLegacy/mac/Plugins/WebBaseNetscapePluginView.mm
Source/WebKitLegacy/mac/Plugins/WebBasePluginPackage.mm
Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKitLegacy/mac/WebView/WebArchive.mm
Source/WebKitLegacy/mac/WebView/WebDataSource.mm
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebResource.mm
Source/WebKitLegacy/mac/WebView/WebTextIterator.mm
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/mac/WebView/WebViewData.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebKitClassFactory.cpp
Source/WebKitLegacy/win/WebView.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp
Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp
Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp
Tools/TestWebKitAPI/Tests/WebCore/StringUtilities.mm
Tools/TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm
Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp
Tools/WebKitTestRunner/TestController.cpp

index 469a636..374251c 100644 (file)
@@ -51,7 +51,7 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass*
     , convertToType(definition->convertToType)
     , m_className(String::fromUTF8(definition->className))
 {
-    initializeThreading();
+    JSC::initialize();
 
     if (const JSStaticValue* staticValue = definition->staticValues) {
         m_staticValues = makeUnique<OpaqueJSClassStaticValuesTable>();
index 45d7348..efa0e4b 100644 (file)
@@ -66,7 +66,7 @@ using namespace JSC;
 
 JSContextGroupRef JSContextGroupCreate()
 {
-    initializeThreading();
+    JSC::initialize();
     return toRef(&VM::createContextGroup().leakRef());
 }
 
@@ -116,7 +116,7 @@ void JSContextGroupClearExecutionTimeLimit(JSContextGroupRef group)
 
 JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass)
 {
-    initializeThreading();
+    JSC::initialize();
 
 #if OS(DARWIN)
     // If the application was linked before JSGlobalContextCreate was changed to use a unique VM,
@@ -131,7 +131,7 @@ JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass)
 
 JSGlobalContextRef JSGlobalContextCreateInGroup(JSContextGroupRef group, JSClassRef globalObjectClass)
 {
-    initializeThreading();
+    JSC::initialize();
 
     Ref<VM> vm = group ? Ref<VM>(*toJS(group)) : VM::createContextGroup();
 
index b09d99c..d9aebf7 100644 (file)
@@ -56,7 +56,7 @@ using namespace JSC;
 
 JSClassRef JSClassCreate(const JSClassDefinition* definition)
 {
-    initializeThreading();
+    JSC::initialize();
     auto jsClass = (definition->attributes & kJSClassAttributeNoAutomaticPrototype)
         ? OpaqueJSClass::createNoAutomaticPrototype(definition)
         : OpaqueJSClass::create(definition);
index f5cb875..4d64004 100644 (file)
@@ -36,13 +36,13 @@ using namespace WTF::Unicode;
 
 JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
 {
-    initializeThreading();
+    JSC::initialize();
     return &OpaqueJSString::create(reinterpret_cast<const UChar*>(chars), numChars).leakRef();
 }
 
 JSStringRef JSStringCreateWithUTF8CString(const char* string)
 {
-    initializeThreading();
+    JSC::initialize();
     if (string) {
         size_t length = strlen(string);
         Vector<UChar, 1024> buffer(length);
@@ -61,7 +61,7 @@ JSStringRef JSStringCreateWithUTF8CString(const char* string)
 
 JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars)
 {
-    initializeThreading();
+    JSC::initialize();
     return OpaqueJSString::tryCreate(StringImpl::createWithoutCopying(reinterpret_cast<const UChar*>(chars), numChars)).leakRef();
 }
 
index 1367715..55effd0 100644 (file)
@@ -35,7 +35,7 @@
 
 JSStringRef JSStringCreateWithCFString(CFStringRef string)
 {
-    JSC::initializeThreading();
+    JSC::initialize();
 
     // We cannot use CFIndex here since CFStringGetLength can return values larger than
     // it can hold.  (<rdar://problem/6806478>)
index 6d9b6a1..71d1c33 100644 (file)
@@ -100,7 +100,7 @@ void testCompareAndSwap()
     RefPtr<Thread> threads[numThreads];
     Data data[numThreads];
 
-    WTF::initializeThreading();
+    WTF::initialize();
     
     printf("Starting %d threads for CompareAndSwap test.  Test should complete without hanging.\n", numThreads);
     for (int i = 0; i < numThreads; i++) {
index 7b3ac51..b197dd5 100644 (file)
@@ -127,7 +127,7 @@ int testExecutionTimeLimit()
     
     bool failed = false;
 
-    JSC::initializeThreading();
+    JSC::initialize();
 
     for (auto tierOptions : tierOptionsList) {
         StringBuilder savedOptionsBuilder;
index e652a23..297faf1 100644 (file)
@@ -37,7 +37,7 @@ int testFunctionOverrides()
 {
     bool failed = false;
 
-    JSC::initializeThreading();
+    JSC::initialize();
 
     const char* oldFunctionOverrides = Options::functionOverrides();
     
index dddda1f..5862337 100644 (file)
@@ -49,7 +49,7 @@ static std::vector<std::thread>& threadsList()
 void startMultithreadedMultiVMExecutionTest()
 {
     WTF::initializeMainThread();
-    JSC::initializeThreading();
+    JSC::initialize();
 
 #define CHECK(condition, message) do { \
         if (!condition) { \
index 25febb8..1312fb4 100644 (file)
@@ -116,7 +116,7 @@ int testPingPongStackOverflow()
 {
     bool failed = false;
 
-    JSC::initializeThreading();
+    JSC::initialize();
 
     auto origSoftReservedZoneSize = Options::softReservedZoneSize();
     auto origReservedZoneSize = Options::reservedZoneSize();
index 7839485..6f6174c 100644 (file)
@@ -1,3 +1,59 @@
+2020-06-28  Geoffrey Garen  <ggaren@apple.com>
+
+        Rename initializeThreading to initialize
+        https://bugs.webkit.org/show_bug.cgi?id=213674
+
+        Reviewed by Mark Lam.
+
+        * API/JSClassRef.cpp:
+        * API/JSContextRef.cpp:
+        (JSContextGroupCreate):
+        (JSGlobalContextCreate):
+        (JSGlobalContextCreateInGroup):
+        * API/JSObjectRef.cpp:
+        (JSClassCreate):
+        * API/JSStringRef.cpp:
+        (JSStringCreateWithCharacters):
+        (JSStringCreateWithUTF8CString):
+        (JSStringCreateWithCharactersNoCopy):
+        * API/JSStringRefCF.cpp:
+        (JSStringCreateWithCFString):
+        * API/tests/CompareAndSwapTest.cpp:
+        (testCompareAndSwap):
+        * API/tests/ExecutionTimeLimitTest.cpp:
+        (testExecutionTimeLimit):
+        * API/tests/FunctionOverridesTest.cpp:
+        (testFunctionOverrides):
+        * API/tests/MultithreadedMultiVMExecutionTest.cpp:
+        (startMultithreadedMultiVMExecutionTest):
+        * API/tests/PingPongStackOverflowTest.cpp:
+        (testPingPongStackOverflow):
+        * JavaScriptCore.order:
+        * assembler/testmasm.cpp:
+        (JSC::run):
+        * b3/air/testair.cpp:
+        (main):
+        * b3/testb3_1.cpp:
+        (main):
+        * dfg/testdfg.cpp:
+        (main):
+        * dynbench.cpp:
+        (main):
+        * inspector/remote/cocoa/RemoteInspectorCocoa.mm:
+        (Inspector::RemoteInspector::singleton):
+        * jsc.cpp:
+        (main):
+        (jscmain):
+        * runtime/InitializeThreading.cpp:
+        (JSC::initialize):
+        (JSC::initializeThreading): Deleted.
+        * runtime/InitializeThreading.h:
+        * runtime/JSCConfig.h:
+        * shell/playstation/TestShell.cpp:
+        (setupTestRun):
+        * testRegExp.cpp:
+        (main):
+
 2020-06-27  Saam Barati  <sbarati@apple.com>
 
         BytecodeBasicBlock::addSuccessor should check if the  successor already exists
index cf34559..be9d4b0 100644 (file)
@@ -1,7 +1,4 @@
-__ZN3JSC19initializeThreadingEv
-__ZN3JSCL23initializeThreadingOnceEv
 __ZN3WTF17double_conversion10initializeEv
-__ZN3WTF19initializeThreadingEv
 __ZN3WTF10StringImpl5emptyEv
 __ZN3WTF10fastMallocEm
 __ZN3WTF20TCMalloc_ThreadCache10InitModuleEv
@@ -47,7 +44,6 @@ __ZN3WTF9HashTableIPvNS_12KeyValuePairIS1_PNS_13MetaAllocator13FreeSpaceNodeEEEN
 __ZN3WTF9HashTableIPvNS_12KeyValuePairIS1_PNS_13MetaAllocator13FreeSpaceNodeEEENS_24KeyValuePairKeyExtractorIS6_EENS_7PtrHashIS1_EENS_18HashMapValueTraitsINS_10HashTraitsIS1_EENSC_IS5_EEEESD_E3addINS_17HashMapTranslatorISF_SA_EES1_S5_EENS_18HashTableAddResultINS_17HashTableIteratorIS1_S6_S8_SA_SF_SD_EEEERKT0_RKT1_
 __ZN3WTF8fastFreeEPv
 __ZN3JSC13CodeProfiling15notifyAllocatorEPN3WTF13MetaAllocatorE
-__ZN3JSC7JSStack19initializeThreadingEv
 __ZN3JSC5LLInt10initializeEv
 __ZN3WTF19initializeGCThreadsEv
 __ZN3WTF18FunctionDispatcherC2Ev
index dabb819..0ed0a98 100644 (file)
@@ -2530,7 +2530,7 @@ static void testBranchIfNotType()
 
 void run(const char* filter)
 {
-    JSC::initializeThreading();
+    JSC::initialize();
     unsigned numberOfTests = 0;
 
     Deque<RefPtr<SharedTask<void()>>> tasks;
index dfc8439..39a3baf 100644 (file)
@@ -2511,7 +2511,7 @@ int main(int argc, char** argv)
         break;
     }
     
-    JSC::initializeThreading();
+    JSC::initialize();
 
     for (unsigned i = 0; i <= 2; ++i) {
         JSC::Options::defaultB3OptLevel() = i;
index 04e1e8c..3348025 100644 (file)
@@ -907,7 +907,7 @@ int main(int argc, char** argv)
     JSC::Config::configureForTesting();
 
     WTF::initializeMainThread();
-    JSC::initializeThreading();
+    JSC::initialize();
     
     for (unsigned i = 0; i <= 2; ++i) {
         JSC::Options::defaultB3OptLevel() = i;
index fe3c1ba..fefd4a5 100644 (file)
@@ -111,7 +111,7 @@ int main(int argc, char** argv)
         break;
     }
 
-    JSC::initializeThreading();
+    JSC::initialize();
     
     run(filter);
 
index 17c4f84..8f9e5eb 100644 (file)
@@ -88,7 +88,7 @@ int main(int argc, char** argv)
     }
     
     WTF::initializeMainThread();
-    JSC::initializeThreading();
+    JSC::initialize();
 
     VM& vm = VM::create(LargeHeap).leakRef();
     {
index 430a317..ee01dba 100644 (file)
@@ -97,7 +97,7 @@ RemoteInspector& RemoteInspector::singleton()
         if (canAccessWebInspectorMachPort()) {
             dispatch_block_t initialize = ^{
                 WTF::initializeMainThread();
-                JSC::initializeThreading();
+                JSC::initialize();
                 if (RemoteInspector::startEnabled)
                     shared.get().start();
             };
index 7515bd3..4eb5f41 100644 (file)
@@ -2634,10 +2634,10 @@ int main(int argc, char** argv)
         WTFLogAlways("Locale not supported by C library.\n\tUsing the fallback 'C' locale.");
 #endif
 
-    // Need to initialize WTF threading before we start any threads. Cannot initialize JSC
-    // threading yet, since that would do somethings that we'd like to defer until after we
+    // Need to initialize WTF before we start any threads. Cannot initialize JSC
+    // yet, since that would do somethings that we'd like to defer until after we
     // have a chance to parse options.
-    WTF::initializeThreading();
+    WTF::initialize();
 
 #if PLATFORM(IOS_FAMILY)
     Options::crashIfCantAllocateJITMemory() = true;
@@ -3297,8 +3297,7 @@ int jscmain(int argc, char** argv)
             Options::dumpGeneratedBytecodes() = true;
     }
 
-    // Initialize JSC before getting VM.
-    JSC::initializeThreading();
+    JSC::initialize();
     initializeTimeoutIfNeeded();
 
 #if OS(DARWIN) || OS(LINUX)
index ce58cbf..f80eafd 100644 (file)
@@ -50,12 +50,12 @@ namespace JSC {
 
 static_assert(sizeof(bool) == 1, "LLInt and JIT assume sizeof(bool) is always 1 when touching it directly from assembly code.");
 
-void initializeThreading()
+void initialize()
 {
-    static std::once_flag initializeThreadingOnceFlag;
+    static std::once_flag onceFlag;
 
-    std::call_once(initializeThreadingOnceFlag, []{
-        WTF::initializeThreading();
+    std::call_once(onceFlag, [] {
+        WTF::initialize();
         Options::initialize();
 
         initializePtrTagLookup();
@@ -106,8 +106,8 @@ void initializeThreading()
 #endif
 
         WTF::compilerFence();
-        RELEASE_ASSERT(!g_jscConfig.initializeThreadingHasBeenCalled);
-        g_jscConfig.initializeThreadingHasBeenCalled = true;
+        RELEASE_ASSERT(!g_jscConfig.initializeHasBeenCalled);
+        g_jscConfig.initializeHasBeenCalled = true;
     });
 }
 
index 553e620..3ab3eaf 100644 (file)
@@ -30,8 +30,6 @@
 
 namespace JSC {
 
-// This function must be called from the main thread. It is safe to call it repeatedly.
-// Darwin is an exception to this rule: it is OK to call this function from any thread, even reentrantly.
-JS_EXPORT_PRIVATE void initializeThreading();
+JS_EXPORT_PRIVATE void initialize();
 
 } // namespace JSC
index c72dac0..23791e6 100644 (file)
@@ -62,7 +62,7 @@ struct Config {
     bool jitDisabled;
 
     // The following HasBeenCalled flags are for auditing call_once initialization functions.
-    bool initializeThreadingHasBeenCalled;
+    bool initializeHasBeenCalled;
 
     struct {
 #if ASSERT_ENABLED
index 411e868..2782fda 100644 (file)
@@ -40,15 +40,15 @@ extern "C" void setupTestRun()
     FOR_EACH_JSC_OPTION(STATIC_OPTION)
 #undef STATIC_OPTION
 
-    // Need to initialize WTF threading before we start any threads. Cannot initialize JSC
-    // threading yet, since that would do somethings that we'd like to defer until after we
+    // Need to initialize WTF before we start any threads. Cannot initialize JSC
+    // yet, since that would do somethings that we'd like to defer until after we
     // have a chance to parse options.
     WTF::initializeMainThread();
 
     // Need to override and enable restricted options before we start parsing options below.
     Config::enableRestrictedOptions();
 
-    JSC::initializeThreading();
+    JSC::initialize();
 
 #if ENABLE(WEBASSEMBLY)
     JSC::Wasm::enableFastMemory();
index 2fb6414..21acd5b 100644 (file)
@@ -165,8 +165,7 @@ int main(int argc, char** argv)
     timeBeginPeriod(1);
 #endif
 
-    // Initialize JSC before getting VM.
-    JSC::initializeThreading();
+    JSC::initialize();
 
     // We can't use destructors in the following code because it uses Windows
     // Structured Exception Handling
index 089464d..718ad38 100644 (file)
@@ -1,3 +1,40 @@
+2020-06-28  Geoffrey Garen  <ggaren@apple.com>
+
+        Rename initializeThreading to initialize
+        https://bugs.webkit.org/show_bug.cgi?id=213674
+
+        Reviewed by Mark Lam.
+
+        Reasons:
+
+        (1) You need to call it even if you don't use threads.
+
+        (2) It initializes things unrelated to threads (like the PRNG).
+
+        (3) People seem to get confused about the relationship between
+        initializeThreading() and initializeMainThread(), and sometimes think
+        initializeThreading() is a superset. The opposite is true! I think the
+        confusion may come from "threading" being read as "all threading".
+
+        Some filenames still use the legacy name. We can fix that in post.
+
+        * benchmarks/ConditionSpeedTest.cpp:
+        (main):
+        * benchmarks/HashSetDFGReplay.cpp:
+        (main):
+        * benchmarks/LockFairnessTest.cpp:
+        (main):
+        * benchmarks/LockSpeedTest.cpp:
+        (main):
+        * wtf/MainThread.cpp:
+        (WTF::initializeMainThread):
+        * wtf/Threading.cpp:
+        (WTF::Thread::create):
+        (WTF::initialize):
+        (WTF::initializeThreading): Deleted.
+        * wtf/Threading.h:
+        (WTF::Thread::current):
+
 2020-06-27  Sam Weinig  <weinig@apple.com>
 
         Improve assertions in StringParsingBuffer 
index 1c0d5d3..9d59575 100644 (file)
@@ -193,7 +193,7 @@ void runBenchmark(
 
 int main(int argc, char** argv)
 {
-    WTF::initializeThreading();
+    WTF::initialize();
 
     if (argc != 6
         || sscanf(argv[2], "%u", &numProducers) != 1
index b66d582..b5e1c92 100644 (file)
@@ -10984,7 +10984,7 @@ void benchmark()
 
 int main(int, char**)
 {
-    WTF::initializeThreading();
+    WTF::initialize();
     
     WallTime before = WallTime::now();
     
index 8c97c1a..e63a348 100644 (file)
@@ -115,7 +115,7 @@ struct Benchmark {
 
 int main(int argc, char** argv)
 {
-    WTF::initializeThreading();
+    WTF::initialize();
     
     if (argc != 5
         || sscanf(argv[2], "%u", &numThreads) != 1
index be7aba3..b20dd7e 100644 (file)
@@ -159,7 +159,7 @@ bool parseValue(const char* string, unsigned* variable)
 
 int main(int argc, char** argv)
 {
-    WTF::initializeThreading();
+    WTF::initialize();
     
     if (argc != 8
         || !parseValue(argv[2], &numThreadGroups)
index 437c9d4..ba23924 100644 (file)
@@ -53,7 +53,7 @@ void initializeMainThread()
 {
     static std::once_flag initializeKey;
     std::call_once(initializeKey, [] {
-        initializeThreading();
+        initialize();
         initializeMainThreadPlatform();
         RunLoop::initializeMain();
     });
index 89a7112..5a05f75 100644 (file)
@@ -169,7 +169,7 @@ void Thread::entryPoint(NewThreadContext* newThreadContext)
 
 Ref<Thread> Thread::create(const char* name, Function<void()>&& entryPoint, ThreadType threadType)
 {
-    WTF::initializeThreading();
+    WTF::initialize();
     Ref<Thread> thread = adoptRef(*new Thread());
     Ref<NewThreadContext> context = adoptRef(*new NewThreadContext { name, WTFMove(entryPoint), thread.copyRef() });
     // Increment the context ref on behalf of the created thread. We do not just use a unique_ptr and leak it to the created thread because both the creator and created thread has a need to keep the context alive:
@@ -352,7 +352,7 @@ void Thread::dump(PrintStream& out) const
 ThreadSpecificKey Thread::s_key = InvalidThreadSpecificKey;
 #endif
 
-void initializeThreading()
+void initialize()
 {
     static std::once_flag onceKey;
     std::call_once(onceKey, [] {
index 26efc9b..4b5095f 100644 (file)
@@ -66,8 +66,7 @@ enum class ThreadGroupAddResult;
 class ThreadGroup;
 class PrintStream;
 
-// This function can be called from any threads.
-WTF_EXPORT_PRIVATE void initializeThreading();
+WTF_EXPORT_PRIVATE void initialize();
 
 #if USE(PTHREADS)
 
@@ -95,7 +94,7 @@ enum class ThreadType : uint8_t {
 class Thread : public ThreadSafeRefCounted<Thread> {
 public:
     friend class ThreadGroup;
-    friend WTF_EXPORT_PRIVATE void initializeThreading();
+    friend WTF_EXPORT_PRIVATE void initialize();
 
     WTF_EXPORT_PRIVATE ~Thread();
 
@@ -377,11 +376,11 @@ inline Thread& Thread::current()
     //    Thread::current() is used on main thread before it could possibly be used
     //    on secondary ones, so there is no need for synchronization here.
     // WRT JavaScriptCore:
-    //    Thread::initializeTLSKey() is initially called from initializeThreading(), ensuring
+    //    Thread::initializeTLSKey() is initially called from initialize(), ensuring
     //    this is initially called in a std::call_once locked context.
 #if !HAVE(FAST_TLS) && !OS(WINDOWS)
     if (UNLIKELY(Thread::s_key == InvalidThreadSpecificKey))
-        WTF::initializeThreading();
+        WTF::initialize();
 #endif
     if (auto* thread = currentMayBeNull())
         return *thread;
index d77182b..4c2cc4e 100644 (file)
@@ -1,3 +1,26 @@
+2020-06-28  Geoffrey Garen  <ggaren@apple.com>
+
+        Rename initializeThreading to initialize
+        https://bugs.webkit.org/show_bug.cgi?id=213674
+
+        Reviewed by Mark Lam.
+
+        * Modules/webdatabase/DatabaseManager.cpp:
+        (WebCore::DatabaseManager::openDatabase):
+        * WebCore.order:
+        * bindings/js/CommonVM.cpp:
+        (WebCore::commonVMSlow):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::initializeMainThread):
+        (WebCore::ScriptController::initializeThreading): Deleted.
+        * bindings/js/ScriptController.h:
+        * bridge/objc/WebScriptObject.mm:
+        (+[WebScriptObject initialize]):
+        * platform/cocoa/SharedBufferCocoa.mm:
+        (+[WebCoreSharedBufferData initialize]):
+        * platform/ios/wak/WebCoreThread.mm:
+        (RunWebThread):
+
 2020-06-28  Youenn Fablet  <youenn@apple.com>
 
         MediaRecorder stopRecorder() returns empty Blob after first use
index 5ef6687..51ad8a8 100644 (file)
@@ -194,7 +194,11 @@ void DatabaseManager::removeProposedDatabase(ProposedDatabase& database)
 ExceptionOr<Ref<Database>> DatabaseManager::openDatabase(Document& document, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, RefPtr<DatabaseCallback>&& creationCallback)
 {
     ASSERT(isMainThread());
-    ScriptController::initializeThreading();
+
+    // FIXME: Remove this call to ScriptController::initializeMainThread(). The
+    // main thread should have been initialized by a WebKit entrypoint already.
+    // Also, initializeMainThread() does nothing on iOS.
+    ScriptController::initializeMainThread();
 
     bool setVersionInNewDatabase = !creationCallback;
     auto openResult = openDatabaseBackend(document, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase);
index c97ef52..d643d5b 100644 (file)
@@ -2545,7 +2545,6 @@ __ZN7WebCore11MemoryCache32removeFragmentIdentifierIfNeededERKNS_4KURLE
 __ZN7WebCore20CachedResourceLoader10canRequestENS_14CachedResource4TypeERKNS_4KURLEb
 __ZN7WebCore16ScriptController42shouldBypassMainWorldContentSecurityPolicyEv
 __ZN7WebCore15JSDOMWindowBase8commonVMEv
-__ZN7WebCore16ScriptController19initializeThreadingEv
 __ZN7WebCore15DOMWrapperWorldC1EPN3JSC2VMEb
 __ZN3WTF9HashTableIPN7WebCore15DOMWrapperWorldES3_NS_17IdentityExtractorENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES8_E3addINS_22IdentityHashTranslatorIS6_EES3_S3_EENS_18HashTableAddResultINS_17HashTableIteratorIS3_S3_S4_S6_S8_S8_EEEERKT0_RKT1_
 __ZN3WTF9HashTableIPN7WebCore15DOMWrapperWorldES3_NS_17IdentityExtractorENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES8_E6rehashEi
index 9f2ca5f..23730ff 100644 (file)
@@ -50,7 +50,10 @@ JSC::VM& commonVMSlow()
     ASSERT(isMainThread());
     ASSERT(!g_commonVMOrNull);
 
-    ScriptController::initializeThreading();
+    // FIXME: Remove this call to ScriptController::initializeMainThread(). The
+    // main thread should have been initialized by a WebKit entrypoint already.
+    // Also, initializeMainThread() does nothing on iOS.
+    ScriptController::initializeMainThread();
 
     auto& vm = JSC::VM::create(JSC::LargeHeap).leakRef();
 
index 1a24823..cc20121 100644 (file)
 namespace WebCore {
 using namespace JSC;
 
-void ScriptController::initializeThreading()
+void ScriptController::initializeMainThread()
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index eceb47b..26d9fc6 100644 (file)
@@ -112,9 +112,7 @@ public:
     // This asserts that URL argument is a JavaScript URL.
     void executeJavaScriptURL(const URL&, RefPtr<SecurityOrigin> = nullptr, ShouldReplaceDocumentIfJavaScriptURL = ReplaceDocumentIfJavaScriptURL);
 
-    // This function must be called from the main thread. It is safe to call it repeatedly.
-    // Darwin is an exception to this rule: it is OK to call this function from any thread, even reentrantly.
-    static void initializeThreading();
+    static void initializeMainThread();
 
     void loadModuleScriptInWorld(LoadableModuleScript&, const String& moduleName, Ref<ModuleFetchParameters>&&, DOMWrapperWorld&);
     void loadModuleScript(LoadableModuleScript&, const String& moduleName, Ref<ModuleFetchParameters>&&);
index 5431a89..b2e5ca5 100644 (file)
@@ -164,7 +164,7 @@ void disconnectWindowWrapper(WebScriptObject *windowWrapper)
 + (void)initialize
 {
 #if !USE(WEB_THREAD)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index 343897a..8f8e533 100644 (file)
@@ -44,7 +44,7 @@
 + (void)initialize
 {
 #if !USE(WEB_THREAD)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif // !USE(WEB_THREAD)
 }
index b348b71..c5827c6 100644 (file)
@@ -584,11 +584,11 @@ static void* RunWebThread(void*)
 {
     FloatingPointEnvironment::singleton().propagateMainThreadEnvironment();
 
-    // WTF::initializeWebThread() needs to be called before JSC::initializeThreading() since the
+    // WTF::initializeWebThread() needs to be called before JSC::initialize() since the
     // code invoked by the latter needs to know if it's running on the WebThread. See
     // <rdar://problem/8502487>.
     WTF::initializeWebThread();
-    JSC::initializeThreading();
+    JSC::initialize();
     
     // Make sure that the WebThread and the main thread share the same ThreadGlobalData objects.
     WebCore::threadGlobalData().setWebCoreThreadData();
index 015681b..e011ca9 100644 (file)
@@ -1,3 +1,17 @@
+2020-06-28  Geoffrey Garen  <ggaren@apple.com>
+
+        Rename initializeThreading to initialize
+        https://bugs.webkit.org/show_bug.cgi?id=213674
+
+        Reviewed by Mark Lam.
+
+        * Shared/API/c/WKString.cpp:
+        (WKStringCopyJSString):
+        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
+        (WebKit::runInitializationCode):
+        * Shared/WebKit2Initialize.cpp:
+        (WebKit::InitializeWebKit2):
+
 2020-06-28  Daniel Bates  <dabates@apple.com>
 
         [iOS] Clean up visible position comparisons in WebPage::requestDocumentEditingContext()
index 52bc355..2ae6282 100644 (file)
@@ -133,6 +133,6 @@ WKStringRef WKStringCreateWithJSString(JSStringRef jsStringRef)
 
 JSStringRef WKStringCopyJSString(WKStringRef stringRef)
 {
-    JSC::initializeThreading();
+    JSC::initialize();
     return OpaqueJSString::tryCreate(WebKit::toImpl(stringRef)->string()).leakRef();
 }
index 60b32da..256f749 100644 (file)
@@ -52,7 +52,7 @@ static void runInitializationCode(void* = nullptr)
     InitWebCoreThreadSystemInterface();
 #endif
 
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 
     WTF::RefCountedBase::enableThreadingChecksGlobally();
index df7ae01..4a53f2c 100644 (file)
@@ -39,7 +39,7 @@ namespace WebKit {
 
 void InitializeWebKit2()
 {
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
     AtomString::init();
 
index 297741a..7077af1 100644 (file)
@@ -1,3 +1,50 @@
+2020-06-28  Geoffrey Garen  <ggaren@apple.com>
+
+        Rename initializeThreading to initialize
+        https://bugs.webkit.org/show_bug.cgi?id=213674
+
+        Reviewed by Mark Lam.
+
+        * History/WebBackForwardList.mm:
+        (+[WebBackForwardList initialize]):
+        * History/WebHistoryItem.mm:
+        (+[WebHistoryItem initialize]):
+        * Misc/WebCache.mm:
+        (+[WebCache initialize]):
+        * Misc/WebElementDictionary.mm:
+        (+[WebElementDictionary initialize]):
+        * Misc/WebIconDatabase.mm:
+        * Misc/WebStringTruncator.mm:
+        (+[WebStringTruncator initialize]):
+        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+        (+[WebHostedNetscapePluginView initialize]):
+        * Plugins/WebBaseNetscapePluginView.mm:
+        * Plugins/WebBasePluginPackage.mm:
+        (+[WebBasePluginPackage initialize]):
+        * Plugins/WebNetscapePluginView.mm:
+        (+[WebNetscapePluginView initialize]):
+        * WebCoreSupport/WebEditorClient.mm:
+        (+[WebUndoStep initialize]):
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (+[WebFramePolicyListener initialize]):
+        * WebView/WebArchive.mm:
+        (+[WebArchivePrivate initialize]):
+        * WebView/WebDataSource.mm:
+        (+[WebDataSource initialize]):
+        * WebView/WebHTMLView.mm:
+        (+[WebHTMLViewPrivate initialize]):
+        (+[WebHTMLView initialize]):
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        * WebView/WebResource.mm:
+        (+[WebResourcePrivate initialize]):
+        * WebView/WebTextIterator.mm:
+        (+[WebTextIteratorPrivate initialize]):
+        * WebView/WebView.mm:
+        (+[WebView initialize]):
+        * WebView/WebViewData.mm:
+        (+[WebViewPrivate initialize]):
+
 2020-06-26  Geoffrey Garen  <ggaren@apple.com>
 
         WebSecurityOrigin needs to initialize the main thread
index e90e2bc..f2f13eb 100644 (file)
@@ -98,7 +98,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index fa42d19..f688dc8 100644 (file)
@@ -125,7 +125,7 @@ void WKNotifyHistoryItemChanged(HistoryItem&)
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index 39b841f..ab8301d 100644 (file)
@@ -63,7 +63,7 @@ class DefaultStorageSessionProvider : public WebCore::StorageSessionProvider {
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index e574ffb..9982905 100644 (file)
@@ -67,7 +67,7 @@ static void cacheValueForKey(const void *key, const void *value, void *self)
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index 8d17fa1..4c1dcb2 100644 (file)
@@ -97,7 +97,7 @@ ALLOW_DEPRECATED_IMPLEMENTATIONS_END
 
 + (void)initialize
 {
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 }
 
index 8d81e01..99d79c1 100644 (file)
@@ -50,7 +50,7 @@ static WebCore::FontCascade& fontFromNSFont(NSFont *font)
 
 + (void)initialize
 {
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 }
 
index 4b99b53..476a55e 100644 (file)
@@ -105,7 +105,7 @@ extern "C" {
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
     sendUserChangeNotifications();
index c917a39..7ec40c9 100644 (file)
@@ -70,7 +70,7 @@ using namespace WebCore;
 
 + (void)initialize
 {
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
     WebKit::sendUserChangeNotifications();
 }
index 3331baf..ade7ba2 100644 (file)
@@ -59,7 +59,7 @@
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index 9830cec..2caee2f 100644 (file)
@@ -162,7 +162,7 @@ typedef struct {
 
 + (void)initialize
 {
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
     sendUserChangeNotifications();
 }
index b276ed4..9ab1c29 100644 (file)
@@ -138,7 +138,7 @@ static WebViewInsertAction kit(EditorInsertAction action)
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index 7c22d96..3c5f5fe 100644 (file)
@@ -2342,7 +2342,7 @@ void WebFrameLoaderClient::finishedLoadingIcon(uint64_t callbackID, WebCore::Sha
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index 8f4106d..b237c98 100644 (file)
@@ -69,7 +69,7 @@ static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives";
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index 3b97a8c..d777264 100644 (file)
@@ -153,7 +153,7 @@ void addTypesFromClass(NSMutableDictionary *allTypes, Class objCClass, NSArray *
 {
     if (self == [WebDataSource class]) {
 #if !PLATFORM(IOS_FAMILY)
-        JSC::initializeThreading();
+        JSC::initialize();
         WTF::initializeMainThread();
 #endif
     }
index 3c1da21..d938e76 100644 (file)
@@ -1031,7 +1031,7 @@ static NSControlStateValue kit(TriState state)
     // FIXME: Shouldn't all of this move into +[WebHTMLView initialize]?
     // And some of this work is likely redundant since +[WebHTMLView initialize] is guaranteed to run first.
 
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 
     if (!oldSetCursorForMouseLocationIMP) {
@@ -2565,7 +2565,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
 {
     [NSApp registerServicesMenuSendTypes:[[self class] _selectionPasteboardTypes] returnTypes:[[self class] _insertablePasteboardTypes]];
 
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 }
 
index 09e305a..9c0e7ad 100644 (file)
@@ -387,7 +387,7 @@ public:
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
     bool attachmentElementEnabled = MacApplication::isAppleMail();
     bool webSQLEnabled = false;
index 49caf90..447e2a1 100644 (file)
@@ -67,7 +67,7 @@ static NSString * const WebResourceResponseKey =          @"WebResourceResponse"
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index f1b23e2..8c7e7ee 100644 (file)
@@ -47,7 +47,7 @@
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index 6aca89d..3415cba 100644 (file)
@@ -5557,7 +5557,7 @@ IGNORE_WARNINGS_END
     initialized = YES;
 
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 
index c2d485e..fce4a66 100644 (file)
@@ -167,7 +167,7 @@ void WebViewLayerFlushScheduler::layerFlushCallback()
 + (void)initialize
 {
 #if !PLATFORM(IOS_FAMILY)
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 #endif
 }
index b30dc5c..2b54396 100644 (file)
@@ -1,3 +1,15 @@
+2020-06-28  Geoffrey Garen  <ggaren@apple.com>
+
+        Rename initializeThreading to initialize
+        https://bugs.webkit.org/show_bug.cgi?id=213674
+
+        Reviewed by Mark Lam.
+
+        * WebKitClassFactory.cpp:
+        (WebKitClassFactory::WebKitClassFactory):
+        * WebView.cpp:
+        (WebView::WebView):
+
 2020-06-26  Geoffrey Garen  <ggaren@apple.com>
 
         Initializing the main thread should initialize the main run loop
index a61ede7..0a9ac11 100644 (file)
@@ -63,7 +63,7 @@
 WebKitClassFactory::WebKitClassFactory(CLSID targetClass)
     : m_targetClass(targetClass)
 {
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
 
     gClassCount++;
index 22c5075..2001df1 100644 (file)
@@ -420,7 +420,7 @@ bool WebView::s_allowSiteSpecificHacks = false;
 
 WebView::WebView()
 {
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
     WTF::setProcessPrivileges(allPrivileges());
     WebCore::NetworkStorageSession::permitProcessToUseCookieAPI(true);
index bea1c06..39bbeda 100644 (file)
@@ -1,3 +1,25 @@
+2020-06-28  Geoffrey Garen  <ggaren@apple.com>
+
+        Rename initializeThreading to initialize
+        https://bugs.webkit.org/show_bug.cgi?id=213674
+
+        Reviewed by Mark Lam.
+
+        * TestWebKitAPI/Tests/WebCore/ApplicationManifestParser.cpp:
+        (ApplicationManifestParserTest::SetUp):
+        * TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
+        (TestWebKitAPI::ComplexTextControllerTest::SetUp):
+        * TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
+        (TestWebKitAPI::ContentExtensionTest::SetUp):
+        * TestWebKitAPI/Tests/WebCore/StringUtilities.mm:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebCore/cocoa/WebCoreNSURLSession.mm:
+        (TestWebKitAPI::WebCoreNSURLSessionTest::SetUp):
+        * TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp:
+        (WebKitTestServer::WebKitTestServer):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::initialize):
+
 2020-06-27  Daniel Bates  <dabates@apple.com>
 
         Revert r262654 because it caused <rdar://problem/64664156>.
index b44f543..e0e5bb5 100644 (file)
@@ -56,7 +56,7 @@ public:
 
     virtual void SetUp()
     {
-        JSC::initializeThreading();
+        JSC::initialize();
         WTF::initializeMainThread();
 
         m_manifestURL = { { }, "https://example.com/manifest.json" };
index 3b52ac0..08509fd 100644 (file)
@@ -39,7 +39,7 @@ class ComplexTextControllerTest : public testing::Test {
 public:
     virtual void SetUp()
     {
-        JSC::initializeThreading();
+        JSC::initialize();
         WTF::initializeMainThread();
     }
 };
index 13a8f90..86c6dbc 100644 (file)
@@ -75,7 +75,7 @@ class ContentExtensionTest : public testing::Test {
 public:
     virtual void SetUp()
     {
-        JSC::initializeThreading();
+        JSC::initialize();
         WTF::initializeMainThread();
     }
 };
index 7078384..683010c 100644 (file)
@@ -35,7 +35,7 @@ namespace TestWebKitAPI {
 
 TEST(WebCore, WildcardStringMatching)
 {
-    JSC::initializeThreading();
+    JSC::initialize();
 
     String wildcardString = "a*b";
     EXPECT_TRUE(stringMatchesWildcardString("aaaabb", "a*b"));
index 918e105..732278f 100644 (file)
@@ -114,7 +114,7 @@ public:
     virtual void SetUp()
     {
 #if PLATFORM(IOS_FAMILY)
-        JSC::initializeThreading();
+        JSC::initialize();
 #endif
         view = [[WebView alloc] initWithFrame:NSZeroRect];
         view.frameLoadDelegate = [[[TestNSURLSessionLoaderDelegate alloc] init] autorelease];
index 69ac6c4..d2e495c 100644 (file)
@@ -27,7 +27,7 @@
 WebKitTestServer::WebKitTestServer(ServerOptions options)
 {
     if (options & ServerRunInThread) {
-        WTF::initializeThreading();
+        WTF::initialize();
         m_queue = WorkQueue::create("WebKitTestServer");
     }
 
index 35006ac..d77c413 100644 (file)
@@ -444,7 +444,7 @@ void TestController::initialize(int argc, const char* argv[])
 {
     AutodrainedPool pool;
 
-    JSC::initializeThreading();
+    JSC::initialize();
     WTF::initializeMainThread();
     WTF::setProcessPrivileges(allPrivileges());