Bug 203550 - [JSC] DateMath should have TimeClipped version
Summary: [JSC] DateMath should have TimeClipped version
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on: 202187
Blocks:
  Show dependency treegraph
 
Reported: 2019-10-28 21:10 PDT by Yusuke Suzuki
Modified: 2019-10-31 09:14 PDT (History)
11 users (show)

See Also:


Attachments
Patch (32.47 KB, patch)
2019-10-29 18:34 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (34.99 KB, patch)
2019-10-29 20:02 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (34.33 KB, patch)
2019-10-29 20:09 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (32.54 KB, patch)
2019-10-30 19:32 PDT, Yusuke Suzuki
sbarati: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2019-10-28 21:10:51 PDT
ECMAScript uses milliseconds (double) as its internal representation, but Date constructor and its operation clips this double before actually using it.
As a result, this milliseconds is always within 53bit, and it is always integer. This means that we should use int64_t when calculating GregorianDateTime.
When running instruments profiler, 31% of time is consumed by `fmod`. This is really fun, we should use integers instead.
Comment 1 Radar WebKit Bug Importer 2019-10-29 16:48:01 PDT
<rdar://problem/56726976>
Comment 2 Yusuke Suzuki 2019-10-29 18:34:50 PDT
Created attachment 382260 [details]
Patch
Comment 3 Yusuke Suzuki 2019-10-29 20:02:34 PDT
Created attachment 382268 [details]
Patch
Comment 4 Yusuke Suzuki 2019-10-29 20:09:47 PDT
Created attachment 382270 [details]
Patch
Comment 5 Yusuke Suzuki 2019-10-30 19:32:11 PDT
Created attachment 382412 [details]
Patch
Comment 6 Yusuke Suzuki 2019-10-31 09:14:09 PDT
Committed r251852: <https://trac.webkit.org/changeset/251852>