| Summary: | [JSC] Add fast path for BigInt32 left-shift | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||||||
| Component: | New Bugs | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer | ||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||
| Version: | WebKit Nightly Build | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Yusuke Suzuki
2020-04-25 13:53:58 PDT
Created attachment 397581 [details]
Patch
Comment on attachment 397581 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397581&action=review > Source/JavaScriptCore/runtime/Operations.h:776 > + int64_t result64 = static_cast<int64_t>(leftInt32) << rightInt32; you need to check if this is a left shift, right? Comment on attachment 397581 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397581&action=review Nice. r=me >> Source/JavaScriptCore/runtime/Operations.h:776 >> + int64_t result64 = static_cast<int64_t>(leftInt32) << rightInt32; > > you need to check if this is a left shift, right? sorry, I missed the above !isLeft branch Comment on attachment 397581 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397581&action=review > Source/JavaScriptCore/runtime/Operations.h:765 > rightInt32 = -rightInt32; BTW, while this is completely separate issue from this, is this right? What happens if rightInt32 is INT32_MIN? Comment on attachment 397581 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397581&action=review > Source/JavaScriptCore/runtime/Operations.h:-770 > - return jsBigInt32(leftInt32 >> std::min(rightInt32, 31)); I thought this is right in terms of int32 spec, but it seems that BigInt is not using rounding. So this is wrong. Will just use std::min. Created attachment 397582 [details]
Patch for landing
Created attachment 397583 [details]
Patch for landing
Created attachment 397584 [details]
Patch for landing
Committed r260711: <https://trac.webkit.org/changeset/260711> |