Bug 203550

Summary: [JSC] DateMath should have TimeClipped version
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, dbates, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 202187    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch saam: review+

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>