bmalloc: speed up the lock slow path
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2016 00:15:50 +0000 (00:15 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Aug 2016 00:15:50 +0000 (00:15 +0000)
commit4ad6555e17c21c8ccde298c8e4ca864b8f8f1c20
tree0f9ff08dfe74e9ca4f677a1ceed81bc055f7fc15
parentdcd7b7a4bca1470a8da6f1397f1d3aa1d9f122a3
bmalloc: speed up the lock slow path
https://bugs.webkit.org/show_bug.cgi?id=161058

Unreviewed roll-in - with regression fixed.

Revert to using yield() instead of swtch() because very low priority
background tasks can cause priority inversion and deadlock. In the
network process, that happened with com.apple.WebKit.Cache.Storage.serialBackground.

Still a big speedup on MallocBench.

* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/ScopeExit.h: Added.
(bmalloc::ScopeExit::ScopeExit):
(bmalloc::ScopeExit::~ScopeExit):
(bmalloc::makeScopeExit):
* bmalloc/StaticMutex.cpp:
(bmalloc::StaticMutex::lockSlowCase):
* bmalloc/StaticMutex.h:
(bmalloc::StaticMutex::init):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/bmalloc/ChangeLog
Source/bmalloc/bmalloc.xcodeproj/project.pbxproj
Source/bmalloc/bmalloc/ScopeExit.h [new file with mode: 0644]
Source/bmalloc/bmalloc/StaticMutex.cpp
Source/bmalloc/bmalloc/StaticMutex.h