Title: [194158] trunk/Source/_javascript_Core
- Revision
- 194158
- Author
- [email protected]
- Date
- 2015-12-16 10:36:20 -0800 (Wed, 16 Dec 2015)
Log Message
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):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (194157 => 194158)
--- trunk/Source/_javascript_Core/ChangeLog 2015-12-16 18:32:22 UTC (rev 194157)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-12-16 18:36:20 UTC (rev 194158)
@@ -1,3 +1,20 @@
+2015-12-16 Saam barati <[email protected]>
+
+ 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):
+
2015-12-16 Caitlin Potter <[email protected]>
[JSC] fix error message for eval/arguments CoverInitializedName in strict code
Modified: trunk/Source/_javascript_Core/jit/ScratchRegisterAllocator.cpp (194157 => 194158)
--- trunk/Source/_javascript_Core/jit/ScratchRegisterAllocator.cpp 2015-12-16 18:32:22 UTC (rev 194157)
+++ trunk/Source/_javascript_Core/jit/ScratchRegisterAllocator.cpp 2015-12-16 18:36:20 UTC (rev 194158)
@@ -125,8 +125,9 @@
return PreservedState(stackAdjustmentSize, extraStackSpace);
}
-void ScratchRegisterAllocator::restoreReusedRegistersByPopping(MacroAssembler& jit, const ScratchRegisterAllocator::PreservedState preservedState)
+void ScratchRegisterAllocator::restoreReusedRegistersByPopping(MacroAssembler& jit, const ScratchRegisterAllocator::PreservedState& preservedState)
{
+ RELEASE_ASSERT(preservedState);
if (!didReuseRegisters())
return;
Modified: trunk/Source/_javascript_Core/jit/ScratchRegisterAllocator.h (194157 => 194158)
--- trunk/Source/_javascript_Core/jit/ScratchRegisterAllocator.h 2015-12-16 18:32:22 UTC (rev 194157)
+++ trunk/Source/_javascript_Core/jit/ScratchRegisterAllocator.h 2015-12-16 18:36:20 UTC (rev 194158)
@@ -70,20 +70,23 @@
struct PreservedState {
PreservedState()
- : PreservedState(0)
+ : numberOfBytesPreserved(std::numeric_limits<unsigned>::max())
+ , extraStackSpaceRequirement(ExtraStackSpace::SpaceForCCall)
{ }
- PreservedState(unsigned numberOfBytes, ExtraStackSpace extraStackSpace = ExtraStackSpace::NoExtraSpace)
+ PreservedState(unsigned numberOfBytes, ExtraStackSpace extraStackSpace)
: numberOfBytesPreserved(numberOfBytes)
, extraStackSpaceRequirement(extraStackSpace)
{ }
+ explicit operator bool() const { return numberOfBytesPreserved != std::numeric_limits<unsigned>::max(); }
+
unsigned numberOfBytesPreserved;
ExtraStackSpace extraStackSpaceRequirement;
};
PreservedState preserveReusedRegistersByPushing(MacroAssembler& jit, ExtraStackSpace);
- void restoreReusedRegistersByPopping(MacroAssembler& jit, PreservedState);
+ void restoreReusedRegistersByPopping(MacroAssembler& jit, const PreservedState&);
RegisterSet usedRegistersForCall() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes