WebKit Bugzilla
Attachment 372237 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-20190617021849.patch (text/plain), 3.64 KB, created by
Yusuke Suzuki
on 2019-06-17 02:18:49 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-06-17 02:18:49 PDT
Size:
3.64 KB
patch
obsolete
>Subversion Revision: 246472 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index b69160bbd2a5852e0875ad425ad3eb33c3e06244..d1c07eaef5d4806121753e2c2ffb27eacb123cbe 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-14 Keith Miller <keith_miller@apple.com> > > Restore PAC based cage. >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 758776bc6e26eb7b84318bfd3a0d75d43e0d1fd6..5dcaaa1fadb47b9ce0c1b08027bef4da656427d6 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-15 Simon Fraser <simon.fraser@apple.com> > > Make layerTreeAsText() output a bit less verbose >diff --git a/Source/JavaScriptCore/runtime/JSLock.cpp b/Source/JavaScriptCore/runtime/JSLock.cpp >index 000969c474614cbee865d24ca1da6b5fba424686..d7ee045260b12c5d5bb01e3ea30c5be92cc85a43 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) { >+ if (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 5277f02c8e112c21f0baa0feb7d4eb0ba053fd6d..367b1917fa3ec25084b18b7d2120e382354441e1 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 9220f0b16079da06089b77e335301adc7efdae1b..20b63a59fec3127e0ca632d0527d2d4ff6e3397c 100644 >--- a/Source/WebCore/bindings/js/CommonVM.cpp >+++ b/Source/WebCore/bindings/js/CommonVM.cpp >@@ -56,6 +56,7 @@ JSC::VM& commonVMSlow() > > g_commonVMOrNull = &vm; > >+ vm.apiLock().makeWebThreadAware(); > vm.heap.acquireAccess(); // At any time, we may do things that affect the GC. > > #if PLATFORM(IOS_FAMILY)
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