Add "explicit operator bool" to ScratchRegisterAllocator::PreservedState
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Dec 2015 18:36:20 +0000 (18:36 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Dec 2015 18:36:20 +0000 (18:36 +0000)
commit6094e9a347fbe0c8c34898b5f0eb0a5bf0e6c5a4
tree366781bec7b1c14f37147a52e9e4943a1559750c
parent905ebc62f2279edfc11830607c370480be48bc93
Add "explicit operator bool" to ScratchRegisterAllocator::PreservedState
https://bugs.webkit.org/show_bug.cgi?id=152337

Reviewed by Mark Lam.

If we have a default constructor, we should also have a way
to tell if a PreservedState is invalid.

* jit/ScratchRegisterAllocator.cpp:
(JSC::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
(JSC::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
* jit/ScratchRegisterAllocator.h:
(JSC::ScratchRegisterAllocator::PreservedState::PreservedState):
(JSC::ScratchRegisterAllocator::PreservedState::operator bool):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jit/ScratchRegisterAllocator.cpp
Source/JavaScriptCore/jit/ScratchRegisterAllocator.h