Summary: | Add some new emitters to the X86_64 and ARM64 MacroAssemblers. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mark Lam <mark.lam> | ||||||||
Component: | JavaScriptCore | Assignee: | Mark Lam <mark.lam> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | ews-watchlist, keith_miller, msaboff, rmorisset, saam, tzagallo, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Mark Lam
2020-05-26 13:59:16 PDT
(In reply to Mark Lam from comment #0) > clearBit64 provides a faster way to clear a bit without having to a shift to > make a mask first. Correction: clearBit64 will emit the shift to make the mask. Created attachment 400277 [details]
proposed patch.
Comment on attachment 400277 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=400277&action=review > Source/JavaScriptCore/ChangeLog:16 > + clearBits64WithMask does the equivalent of and64 with the 1's complement of the > + provided mask. feels weird to call this a "mask" when we're really using ~mask Comment on attachment 400277 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=400277&action=review >> Source/JavaScriptCore/ChangeLog:16 >> + provided mask. > > feels weird to call this a "mask" when we're really using ~mask It is a mask: one that defines the bits to clear instead of the bits to keep (as is the case with and64). I'm open to an alternate term if you can think of anything better. Comment on attachment 400277 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=400277&action=review r=me > Source/JavaScriptCore/ChangeLog:22 > + redundant null check. Do we have any way of easily inserting an assert in the generated code when in debug? It could be useful for these kind of things. > Source/JavaScriptCore/assembler/testmasm.cpp:474 > + auto test = compile([=] (CCallHelpers& jit) { what are you capturing by copy and why? Comment on attachment 400277 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=400277&action=review >> Source/JavaScriptCore/ChangeLog:22 >> + redundant null check. > > Do we have any way of easily inserting an assert in the generated code when in debug? It could be useful for these kind of things. Hmmm, I'll see if it's easy to do. If not, I'll do it in another patch. >> Source/JavaScriptCore/assembler/testmasm.cpp:474 >> + auto test = compile([=] (CCallHelpers& jit) { > > what are you capturing by copy and why? Copy paste error. I'll remove the '='. > Source/JavaScriptCore/assembler/testmasm.cpp:501 > + auto test = compile([=] (CCallHelpers& jit) { Ditto. > Source/JavaScriptCore/assembler/testmasm.cpp:555 > + auto test = compile([=] (CCallHelpers& jit) { Ditto. (In reply to Mark Lam from comment #7) > >> Source/JavaScriptCore/ChangeLog:22 > >> + redundant null check. > > > > Do we have any way of easily inserting an assert in the generated code when in debug? It could be useful for these kind of things. > > Hmmm, I'll see if it's easy to do. If not, I'll do it in another patch. I've added an assertion check. Created attachment 400284 [details]
patch for landing.
Thanks for the review. Here's the updated patch for landing.
(In reply to Mark Lam from comment #8) > (In reply to Mark Lam from comment #7) > > >> Source/JavaScriptCore/ChangeLog:22 > > >> + redundant null check. > > > > > > Do we have any way of easily inserting an assert in the generated code when in debug? It could be useful for these kind of things. > > > > Hmmm, I'll see if it's easy to do. If not, I'll do it in another patch. > > I've added an assertion check. Great, thanks! Created attachment 400285 [details]
patch for landing.
Also added the assertion to MacroAssemblerARM64 as well. ARM64 doesn't really need the check because it's implementation will always have correctly even if the word is 0. However, it's good to have the assertion consistently to help catch logic errors in the client that break this invariant.
Landed in r262168: <http://trac.webkit.org/r262168>. |