Changeset 252671 in webkit
- Timestamp:
- Nov 19, 2019 6:08:26 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r252661 r252671 1 2019-11-19 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [JSC] DisallowVMReentry and DeferGC should use WTF::ThreadSpecific instead of using WTF::threadSpecificKeyCreate directly 4 https://bugs.webkit.org/show_bug.cgi?id=204350 5 6 Reviewed by Yusuke Suzuki. 7 8 WTF provides two thread specific storages, ThreadSpecific and 9 threadSpecificKeyCreate. Only DisallowVMReentry and DeferGC were 10 using the latter. They should use WTF::ThreadSpecific because it 11 is a useful type-safe wrapper class. 12 13 * heap/DeferGC.cpp: 14 * heap/DeferGC.h: 15 (JSC::DisallowGC::initialize): 16 (JSC::DisallowGC::scopeReentryCount): 17 (JSC::DisallowGC::setScopeReentryCount): 18 * runtime/DisallowVMReentry.cpp: 19 * runtime/DisallowVMReentry.h: 20 (JSC::DisallowVMReentry::initialize): 21 (JSC::DisallowVMReentry::scopeReentryCount): 22 (JSC::DisallowVMReentry::setScopeReentryCount): 23 1 24 2019-11-19 Yusuke Suzuki <ysuzuki@apple.com> 2 25 -
trunk/Source/JavaScriptCore/heap/DeferGC.cpp
r215885 r252671 32 32 33 33 #ifndef NDEBUG 34 WTF::ThreadSpecificKey DisallowGC::s_scopeReentryCount = 0;34 LazyNeverDestroyed<ThreadSpecific<unsigned, WTF::CanBeGCThread::True>> DisallowGC::s_scopeReentryCount; 35 35 #endif 36 36 -
trunk/Source/JavaScriptCore/heap/DeferGC.h
r241927 r252671 28 28 #include "DisallowScope.h" 29 29 #include "Heap.h" 30 #include <wtf/NeverDestroyed.h> 30 31 #include <wtf/ThreadSpecific.h> 31 32 … … 90 91 static void initialize() 91 92 { 92 WTF::threadSpecificKeyCreate(&s_scopeReentryCount, 0);93 s_scopeReentryCount.construct(); 93 94 } 94 95 95 96 private: 96 static u intptr_tscopeReentryCount()97 static unsigned scopeReentryCount() 97 98 { 98 return reinterpret_cast<uintptr_t>(WTF::threadSpecificGet(s_scopeReentryCount));99 return *s_scopeReentryCount.get(); 99 100 } 100 static void setScopeReentryCount(u intptr_tvalue)101 static void setScopeReentryCount(unsigned value) 101 102 { 102 WTF::threadSpecificSet(s_scopeReentryCount, reinterpret_cast<void*>(value));103 *s_scopeReentryCount.get() = value; 103 104 } 104 105 105 JS_EXPORT_PRIVATE static WTF::ThreadSpecificKeys_scopeReentryCount;106 JS_EXPORT_PRIVATE static LazyNeverDestroyed<ThreadSpecific<unsigned, WTF::CanBeGCThread::True>> s_scopeReentryCount; 106 107 107 108 #endif // NDEBUG -
trunk/Source/JavaScriptCore/runtime/DisallowVMReentry.cpp
r215885 r252671 32 32 33 33 #ifndef NDEBUG 34 WTF::ThreadSpecificKey DisallowVMReentry::s_scopeReentryCount = 0;34 LazyNeverDestroyed<ThreadSpecific<unsigned, WTF::CanBeGCThread::True>> DisallowVMReentry::s_scopeReentryCount; 35 35 #endif 36 36 -
trunk/Source/JavaScriptCore/runtime/DisallowVMReentry.h
r215885 r252671 27 27 28 28 #include "DisallowScope.h" 29 #include <wtf/NeverDestroyed.h> 29 30 #include <wtf/ThreadSpecific.h> 30 31 … … 48 49 static void initialize() 49 50 { 50 WTF::threadSpecificKeyCreate(&s_scopeReentryCount, 0);51 s_scopeReentryCount.construct(); 51 52 } 52 53 53 54 private: 54 static u intptr_tscopeReentryCount()55 static unsigned scopeReentryCount() 55 56 { 56 return reinterpret_cast<uintptr_t>(WTF::threadSpecificGet(s_scopeReentryCount));57 return *s_scopeReentryCount.get(); 57 58 } 58 static void setScopeReentryCount(u intptr_tvalue)59 static void setScopeReentryCount(unsigned value) 59 60 { 60 WTF::threadSpecificSet(s_scopeReentryCount, reinterpret_cast<void*>(value));61 *s_scopeReentryCount.get() = value; 61 62 } 62 63 63 JS_EXPORT_PRIVATE static WTF::ThreadSpecificKeys_scopeReentryCount;64 JS_EXPORT_PRIVATE static LazyNeverDestroyed<ThreadSpecific<unsigned, WTF::CanBeGCThread::True>> s_scopeReentryCount; 64 65 65 66 #endif // NDEBUG
Note: See TracChangeset
for help on using the changeset viewer.