Changeset 153331 in webkit
- Timestamp:
- Jul 25, 2013 10:01:56 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/APIShims.h
r148704 r153331 60 60 APIEntryShim(ExecState* exec, bool registerThread = true) 61 61 : APIEntryShimWithoutLock(&exec->vm(), registerThread) 62 , m_lockHolder(exec )62 , m_lockHolder(exec->vm().exclusiveThread ? 0 : exec) 63 63 { 64 64 } … … 67 67 APIEntryShim(VM* vm, bool registerThread = true) 68 68 : APIEntryShimWithoutLock(vm, registerThread) 69 , m_lockHolder(vm )69 , m_lockHolder(vm->exclusiveThread ? 0 : vm) 70 70 { 71 71 } … … 84 84 public: 85 85 APICallbackShim(ExecState* exec) 86 : m_dropAllLocks(exec )86 : m_dropAllLocks(exec->vm().exclusiveThread ? 0 : exec) 87 87 , m_vm(&exec->vm()) 88 88 { -
trunk/Source/JavaScriptCore/ChangeLog
r153329 r153331 1 2013-07-25 Yi Shen <max.hong.shen@gmail.com> 2 3 Optimize the thread locks for API Shims 4 https://bugs.webkit.org/show_bug.cgi?id=118573 5 6 Reviewed by Geoffrey Garen. 7 8 Remove the thread lock from API Shims if the VM has an exclusive thread (e.g. the VM 9 only used by WebCore's main thread). 10 11 * API/APIShims.h: 12 (JSC::APIEntryShim::APIEntryShim): 13 (JSC::APICallbackShim::APICallbackShim): 14 * runtime/JSLock.cpp: 15 (JSC::JSLockHolder::JSLockHolder): 16 (JSC::JSLockHolder::init): 17 (JSC::JSLockHolder::~JSLockHolder): 18 (JSC::JSLock::DropAllLocks::DropAllLocks): 19 (JSC::JSLock::DropAllLocks::~DropAllLocks): 20 * runtime/VM.cpp: 21 (JSC::VM::VM): 22 * runtime/VM.h: 23 1 24 2013-07-25 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 25 -
trunk/Source/JavaScriptCore/runtime/JSLock.cpp
r148696 r153331 52 52 53 53 JSLockHolder::JSLockHolder(ExecState* exec) 54 : m_vm( &exec->vm())54 : m_vm(exec ? &exec->vm() : 0) 55 55 { 56 56 init(); … … 71 71 void JSLockHolder::init() 72 72 { 73 m_vm->apiLock().lock(); 73 if (m_vm) 74 m_vm->apiLock().lock(); 74 75 } 75 76 76 77 JSLockHolder::~JSLockHolder() 77 78 { 79 if (!m_vm) 80 return; 81 78 82 RefPtr<JSLock> apiLock(&m_vm->apiLock()); 79 83 m_vm.clear(); … … 216 220 JSLock::DropAllLocks::DropAllLocks(ExecState* exec) 217 221 : m_lockCount(0) 218 , m_vm(&exec->vm()) 219 { 220 m_lockCount = m_vm->apiLock().dropAllLocks(); 222 , m_vm(exec ? &exec->vm() : 0) 223 { 224 if (m_vm) 225 m_lockCount = m_vm->apiLock().dropAllLocks(); 221 226 } 222 227 … … 225 230 , m_vm(vm) 226 231 { 227 m_lockCount = m_vm->apiLock().dropAllLocks(); 232 if (m_vm) 233 m_lockCount = m_vm->apiLock().dropAllLocks(); 228 234 } 229 235 230 236 JSLock::DropAllLocks::~DropAllLocks() 231 237 { 232 m_vm->apiLock().grabAllLocks(m_lockCount); 238 if (m_vm) 239 m_vm->apiLock().grabAllLocks(m_lockCount); 233 240 } 234 241 -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r153276 r153331 176 176 , m_rtTraceList(new RTTraceList()) 177 177 #endif 178 #ifndef NDEBUG179 178 , exclusiveThread(0) 180 #endif181 179 , m_newStringsSinceLastHashCons(0) 182 180 #if ENABLE(ASSEMBLER) -
trunk/Source/JavaScriptCore/runtime/VM.h
r153223 r153331 390 390 #endif 391 391 392 #ifndef NDEBUG393 392 ThreadIdentifier exclusiveThread; 394 #endif395 393 396 394 CachedTranscendentalFunction<std::sin> cachedSin; -
trunk/Source/WebCore/ChangeLog
r153330 r153331 1 2013-07-25 Yi Shen <max.hong.shen@gmail.com> 2 3 Optimize the thread locks for API Shims 4 https://bugs.webkit.org/show_bug.cgi?id=118573 5 6 Reviewed by Geoffrey Garen. 7 8 Remove the thread lock from API Shims if the VM has an exclusive thread (e.g. the VM 9 only used by WebCore's main thread). 10 11 No new tests required since no functionality changed. 12 13 * bindings/js/JSDOMWindowBase.cpp: 14 (WebCore::JSDOMWindowBase::commonVM): 15 1 16 2013-07-25 Bear Travis <betravis@adobe.com> 2 17 -
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
r151605 r153331 185 185 ScriptController::initializeThreading(); 186 186 vm = VM::createLeaked(LargeHeap).leakRef(); 187 #ifndef NDEBUG188 187 vm->exclusiveThread = currentThread(); 189 #endif190 188 initNormalWorldClientData(vm); 191 189 }
Note: See TracChangeset
for help on using the changeset viewer.