JavaScriptCore performance is very bad on Windows
authorpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Jul 2015 09:14:10 +0000 (09:14 +0000)
committerpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Jul 2015 09:14:10 +0000 (09:14 +0000)
commit0da339208d79744a046ec42929026b3700c4e827
tree2d5c5fac7b895686b9ef44b2dfe7c81313982fc7
parent7c8d228381a10b7a1afcb316c07baa66be6effab
JavaScriptCore performance is very bad on Windows
https://bugs.webkit.org/show_bug.cgi?id=146448

Reviewed by Mark Lam.

Source/JavaScriptCore:

Profiling shows that std::this_thread::get_id() is slow on Windows.
Use WTF::currentThread() instead, which calls GetCurrentThreadId().
This is faster on Windows. The issue has been reported to Microsoft,
https://connect.microsoft.com/VisualStudio/feedback/details/1558211.

* runtime/JSLock.cpp:
(JSC::JSLockHolder::~JSLockHolder):
(JSC::JSLock::JSLock):
(JSC::JSLock::willDestroyVM):
(JSC::JSLock::setExclusiveThread):
(JSC::JSLock::lock):
(JSC::JSLock::unlock):
(JSC::JSLock::currentThreadIsHoldingLock):
* runtime/JSLock.h:
(JSC::JSLock::vm):
(JSC::JSLock::hasExclusiveThread):
(JSC::JSLock::exclusiveThread):
* runtime/VM.h:
(JSC::VM::hasExclusiveThread):
(JSC::VM::exclusiveThread):
(JSC::VM::setExclusiveThread):

Source/WebCore:

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM): Compile fix.

Source/WTF:

Updating the stack bounds is time consuming.
Only update the stack bounds when a new fiber is running.

* wtf/WTFThreadData.cpp:
(WTF::WTFThreadData::WTFThreadData):
* wtf/WTFThreadData.h:
(WTF::WTFThreadData::stack):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSLock.cpp
Source/JavaScriptCore/runtime/JSLock.h
Source/JavaScriptCore/runtime/VM.h
Source/WTF/ChangeLog
Source/WTF/wtf/WTFThreadData.cpp
Source/WTF/wtf/WTFThreadData.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowBase.cpp