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)
commita073678bb943f35d37cfa1e62d6f34bdaae91e02
tree0f9ff08dfe74e9ca4f677a1ceed81bc055f7fc15
parent9fd53799677ba908d89ffbd2ce47752e8eeb8d0a
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: http://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