WebKit Bugzilla
Attachment 339640 Details for
Bug 185349
: [WTF] Embed default atomic string table in Thread
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185349-20180505182904.patch (text/plain), 4.62 KB, created by
Yusuke Suzuki
on 2018-05-05 02:29:05 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-05-05 02:29:05 PDT
Size:
4.62 KB
patch
obsolete
>Subversion Revision: 231396 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index b2bea75c04d9732b15e5a64daf9d3a7cd65c2d11..53421de3c064a65c34a6ff0eace6a5bb89edcd55 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,24 @@ >+2018-05-05 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ [WTF] Embed default atomic string table in Thread >+ https://bugs.webkit.org/show_bug.cgi?id=185349 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Do not need to allocate AtomicStringTable separately from Thread >+ since the table's lifetime is completely the same to Thread. >+ >+ This patch just embeds it into Thread's field. >+ >+ * wtf/Threading.cpp: >+ (WTF::Thread::initializeInThread): >+ (WTF::Thread::didExit): >+ * wtf/Threading.h: >+ * wtf/text/AtomicStringTable.cpp: >+ (WTF::AtomicStringTable::create): Deleted. >+ (WTF::AtomicStringTable::destroy): Deleted. >+ * wtf/text/AtomicStringTable.h: >+ > 2018-05-04 Tim Horton <timothy_horton@apple.com> > > Shift to a lower-level framework for simplifying URLs >diff --git a/Source/WTF/wtf/Threading.cpp b/Source/WTF/wtf/Threading.cpp >index d4ce4fc5264ee5c29bea6ad161c0398ee480663a..e41e71a585890ce56f5fb179e1f1675b33b70785 100644 >--- a/Source/WTF/wtf/Threading.cpp >+++ b/Source/WTF/wtf/Threading.cpp >@@ -98,8 +98,15 @@ void Thread::initializeInThread() > if (m_stack.isEmpty()) > m_stack = StackBounds::currentThreadStackBounds(); > m_savedLastStackTop = stack().origin(); >- AtomicStringTable::create(*this); >- m_currentAtomicStringTable = m_defaultAtomicStringTable; >+ >+ m_currentAtomicStringTable = &m_defaultAtomicStringTable; >+#if USE(WEB_THREAD) >+ // On iOS, one AtomicStringTable is shared between the main UI thread and the WebThread. >+ static AtomicStringTable* sharedStringTable = new AtomicStringTable; >+ >+ if (isWebThread() || isUIThread()) >+ m_currentAtomicStringTable = sharedStringTable; >+#endif // USE(WEB_THREAD) > } > > void Thread::entryPoint(NewThreadContext* newThreadContext) >@@ -196,8 +203,6 @@ void Thread::didExit() > } > } > >- AtomicStringTable::destroy(m_defaultAtomicStringTable); >- > // We would like to say "thread is exited" after unregistering threads from thread groups. > // So we need to separate m_isShuttingDown from m_didExit. > auto locker = holdLock(m_mutex); >diff --git a/Source/WTF/wtf/Threading.h b/Source/WTF/wtf/Threading.h >index 47e019fb95c88d454fc1b54f914d633f57b64417..958219e8947ec1acb4b6146aa5ffe90df61ddabc 100644 >--- a/Source/WTF/wtf/Threading.h >+++ b/Source/WTF/wtf/Threading.h >@@ -290,7 +290,7 @@ class Thread : public ThreadSafeRefCounted<Thread> { > #endif > > AtomicStringTable* m_currentAtomicStringTable { nullptr }; >- AtomicStringTable* m_defaultAtomicStringTable { nullptr }; >+ AtomicStringTable m_defaultAtomicStringTable; > > #if ENABLE(STACK_STATS) > StackStats::PerThreadStats m_stackStats; >diff --git a/Source/WTF/wtf/text/AtomicStringTable.cpp b/Source/WTF/wtf/text/AtomicStringTable.cpp >index d422b054eb68846358ac7cab250c2008f552ec43..f0630d9bfea823e511a9034b2da432f2bdd7816f 100644 >--- a/Source/WTF/wtf/text/AtomicStringTable.cpp >+++ b/Source/WTF/wtf/text/AtomicStringTable.cpp >@@ -29,35 +29,10 @@ > > namespace WTF { > >-void AtomicStringTable::create(Thread& thread) >-{ >-#if USE(WEB_THREAD) >- // On iOS, one AtomicStringTable is shared between the main UI thread and the WebThread. >- static AtomicStringTable* sharedStringTable = new AtomicStringTable; >- >- if (isWebThread() || isUIThread()) { >- thread.m_defaultAtomicStringTable = sharedStringTable; >- return; >- } >-#endif // USE(WEB_THREAD) >- thread.m_defaultAtomicStringTable = new AtomicStringTable; >-} >- > AtomicStringTable::~AtomicStringTable() > { > for (auto* string : m_table) > string->setIsAtomic(false); > } > >-void AtomicStringTable::destroy(AtomicStringTable* table) >-{ >-#if USE(WEB_THREAD) >- // We do the following so that destruction of default atomic string table happens only >- // once - on the main UI thread. >- if (isWebThread()) >- return; >-#endif // USE(WEB_THREAD) >- delete table; >-} >- > } >diff --git a/Source/WTF/wtf/text/AtomicStringTable.h b/Source/WTF/wtf/text/AtomicStringTable.h >index 4fd97f25cb7e9b94d1d24e1068c5b21189d73013..a10a554a1d32a2a4eac3ceecf25255b6ac62d562 100644 >--- a/Source/WTF/wtf/text/AtomicStringTable.h >+++ b/Source/WTF/wtf/text/AtomicStringTable.h >@@ -36,8 +36,6 @@ class AtomicStringTable { > public: > WTF_EXPORT_PRIVATE ~AtomicStringTable(); > >- static void create(Thread&); >- static void destroy(AtomicStringTable*); > HashSet<StringImpl*>& table() { return m_table; } > > private:
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 185349
:
339640
|
339643
|
339644
|
339702