WebKit Bugzilla
Attachment 372261 Details for
Bug 198911
: [JSC] JSLock should be WebThread aware
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198911-20190617120336.patch (text/plain), 3.79 KB, created by
Yusuke Suzuki
on 2019-06-17 12:03:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-06-17 12:03:37 PDT
Size:
3.79 KB
patch
obsolete
>Subversion Revision: 246505 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 99c24f8d9a9599b3bd310448df41d183b858800e..d306a7ef5c8ee8eb2c148a2adc0218f0c777f2b1 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,15 @@ >+2019-06-17 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] JSLock should be WebThread aware >+ https://bugs.webkit.org/show_bug.cgi?id=198911 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * runtime/JSLock.cpp: >+ (JSC::JSLock::lock): >+ * runtime/JSLock.h: >+ (JSC::JSLock::makeWebThreadAware): >+ > 2019-06-17 Yusuke Suzuki <ysuzuki@apple.com> > > [JSC] Introduce DisposableCallSiteIndex to enforce type-safety >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c9aed570f939ddec8e12986e9712f8dade127c0b..1cd6233839b7d03398563834ab84f572e191c7f8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,13 @@ >+2019-06-17 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] JSLock should be WebThread aware >+ https://bugs.webkit.org/show_bug.cgi?id=198911 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * bindings/js/CommonVM.cpp: >+ (WebCore::commonVMSlow): >+ > 2019-06-17 Kenneth Russell <kbr@chromium.org> > > Support using ANGLE as the backend for the WebGL implementation >diff --git a/Source/JavaScriptCore/runtime/JSLock.cpp b/Source/JavaScriptCore/runtime/JSLock.cpp >index 7cc3f69d4afc2e7d52ebcb9739c81d297255c52c..afa0592afded42dd880e95c21f6e24512360c9cc 100644 >--- a/Source/JavaScriptCore/runtime/JSLock.cpp >+++ b/Source/JavaScriptCore/runtime/JSLock.cpp >@@ -35,6 +35,10 @@ > #include <wtf/Threading.h> > #include <wtf/threads/Signals.h> > >+#if USE(WEB_THREAD) >+#include <wtf/ios/WebCoreThread.h> >+#endif >+ > namespace JSC { > > Lock GlobalJSLock::s_sharedInstanceMutex; >@@ -105,6 +109,13 @@ void JSLock::lock() > void JSLock::lock(intptr_t lockCount) > { > ASSERT(lockCount > 0); >+#if USE(WEB_THREAD) >+ if (m_webThreadAware) { >+ ASSERT(WebCoreWebThreadIsEnabled && WebCoreWebThreadIsEnabled()); >+ WebCoreWebThreadLock(); >+ } >+#endif >+ > bool success = m_lock.tryLock(); > if (UNLIKELY(!success)) { > if (currentThreadIsHoldingLock()) { >diff --git a/Source/JavaScriptCore/runtime/JSLock.h b/Source/JavaScriptCore/runtime/JSLock.h >index f461f820f9e3aa5f1ec86a02113da2296f3330e8..695ddfdc47ae5ad93c2e7126f74e8d96f1a40a81 100644 >--- a/Source/JavaScriptCore/runtime/JSLock.h >+++ b/Source/JavaScriptCore/runtime/JSLock.h >@@ -119,6 +119,11 @@ class JSLock : public ThreadSafeRefCounted<JSLock> { > unsigned m_dropDepth; > }; > >+ void makeWebThreadAware() >+ { >+ m_webThreadAware = true; >+ } >+ > private: > void lock(intptr_t lockCount); > void unlock(intptr_t unlockCount); >@@ -130,6 +135,7 @@ class JSLock : public ThreadSafeRefCounted<JSLock> { > void grabAllLocks(DropAllLocks*, unsigned lockCount); > > Lock m_lock; >+ bool m_webThreadAware { false }; > // We cannot make m_ownerThread an optional (instead of pairing it with an explicit > // m_hasOwnerThread) because currentThreadIsHoldingLock() may be called from a > // different thread, and an optional is vulnerable to races. >diff --git a/Source/WebCore/bindings/js/CommonVM.cpp b/Source/WebCore/bindings/js/CommonVM.cpp >index c1e94b8b85726b3d51fe11958992351bf37e1b52..09b784f9ed356ad6bcba84f5e63bf8a6f1ea267d 100644 >--- a/Source/WebCore/bindings/js/CommonVM.cpp >+++ b/Source/WebCore/bindings/js/CommonVM.cpp >@@ -59,6 +59,8 @@ JSC::VM& commonVMSlow() > vm.heap.acquireAccess(); // At any time, we may do things that affect the GC. > > #if PLATFORM(IOS_FAMILY) >+ if (WebThreadIsEnabled()) >+ vm.apiLock().makeWebThreadAware(); > vm.setRunLoop(WebThreadRunLoop()); > vm.heap.machineThreads().addCurrentThread(); > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198911
:
372236
|
372237
|
372261
|
372303
|
372319
|
372329
|
372331