Summary: | [JSC] DFG compare should speculate BigInt well | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||||||||
Component: | JavaScriptCore | 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-22 19:28:09 PDT
Created attachment 397308 [details]
Patch
Created attachment 397323 [details]
Patch
WIP
Created attachment 397357 [details]
Patch
Created attachment 397387 [details]
Patch
WIP
Created attachment 397433 [details]
Patch
Comment on attachment 397433 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397433&action=review nice. r=me > Source/JavaScriptCore/runtime/JSBigInt.cpp:2033 > + return ComparisonResult::LessThan; nit: I know this is proven given all other things, but maybe before this, add an "ASSERT(!ySign);" > Source/JavaScriptCore/runtime/JSBigInt.h:293 > +ALWAYS_INLINE JSBigInt::ComparisonResult swapBigIntCompareResult(JSBigInt::ComparisonResult comparisonResult) name nit: swap => invert > Source/JavaScriptCore/runtime/JSBigInt.h:301 > + default: > + return comparisonResult; nit: can we define all cases here, just so we get a compile error in the future? > Source/JavaScriptCore/runtime/Operations.h:314 > + JSValue bigIntValue = JSBigInt::stringToBigInt(globalObject, asString(primValue)->value(globalObject)); don't we need an exception check after ->value() on string? Comment on attachment 397433 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397433&action=review >> Source/JavaScriptCore/runtime/JSBigInt.cpp:2033 >> + return ComparisonResult::LessThan; > > nit: I know this is proven given all other things, but maybe before this, add an > "ASSERT(!ySign);" Sounds nice. Added. >> Source/JavaScriptCore/runtime/JSBigInt.h:293 >> +ALWAYS_INLINE JSBigInt::ComparisonResult swapBigIntCompareResult(JSBigInt::ComparisonResult comparisonResult) > > name nit: > swap => invert Fixed. >> Source/JavaScriptCore/runtime/JSBigInt.h:301 >> + return comparisonResult; > > nit: > > can we define all cases here, just so we get a compile error in the future? Sounds good. Fixed. Committed r260660: <https://trac.webkit.org/changeset/260660> Committed r260664: <https://trac.webkit.org/changeset/260664> |