Summary: | Introducing ScratchRegisterAllocator::PreservedState. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mark Lam <mark.lam> | ||||||
Component: | JavaScriptCore | Assignee: | Mark Lam <mark.lam> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, ggaren, keith_miller, msaboff, saam | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Local Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Mark Lam
2015-12-15 14:34:09 PST
Created attachment 267394 [details]
proposed patch.
Patch looks good. I think we usually say "Saved", which is slightly shorter than "Preserved." EWS is angry, so r-: /Volumes/Data/EWS/WebKit/WebKitBuild/Debug/JavaScriptCore.framework/PrivateHeaders/PolymorphicAccess.h:36:10: fatal error: 'ScratchRegisterAllocator.h' file not found #include "ScratchRegisterAllocator.h" (In reply to comment #2) > I think we usually say "Saved", which is slightly shorter than "Preserved." Talked with Geoff offline. The function that generates thus artifact is named preserveReusedRegistersByPushing(). It would be a mismatch to name the artifact SavedState while keeping the function as is. There are also several other preserve...() functions in ScratchRegisterAllocator unrelated to the patch here. In light of that, for now, we'll stick with calling it PreservedState. > EWS is angry, so r-: Will fix. Created attachment 267404 [details]
Patch with build fix.
Comment on attachment 267404 [details]
Patch with build fix.
r=me
EWS looks angry for unrelated reasons, so you'll need to land manually.
Thanks for the review. Landed in r194126: <http://trac.webkit.org/r194126>. Comment on attachment 267404 [details] Patch with build fix. View in context: https://bugs.webkit.org/attachment.cgi?id=267404&action=review > Source/JavaScriptCore/jit/ScratchRegisterAllocator.h:74 > + PreservedState() > + : PreservedState(0) > + { } Since we have a default empty constructor I think it's worth having an operator bool indicating that a PreservedState is valid or not. We could just make the invalid state have UINT_MAX for preserved bytes. We can assert inside restore / preserve reusedRegisters that we have a valid state. (In reply to comment #7) > Comment on attachment 267404 [details] > Patch with build fix. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=267404&action=review > > > Source/JavaScriptCore/jit/ScratchRegisterAllocator.h:74 > > + PreservedState() > > + : PreservedState(0) > > + { } > > Since we have a default empty constructor I think it's worth having an > operator bool indicating that a PreservedState is valid or not. > We could just make the invalid state have UINT_MAX for preserved bytes. > We can assert inside restore / preserve reusedRegisters that we have a valid > state. I'll write a patch. |