Bug 234836

Summary: [JSC] Implement Temporal.Now.instant()
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, ews-watchlist, keith_miller, mark.lam, msaboff, philip.chimento, ross.kirsling, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ross.kirsling: review+

Description Yusuke Suzuki 2022-01-04 01:11:22 PST
[JSC] Implement Temporal.Now.instant()
Comment 1 Yusuke Suzuki 2022-01-04 01:13:13 PST
Created attachment 448273 [details]
Patch
Comment 2 Ross Kirsling 2022-01-04 10:33:03 PST
Comment on attachment 448273 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=448273&action=review

Seems good to me.

> Source/WTF/wtf/PlatformUse.h:-92
> -/* On Windows, use QueryPerformanceCounter by default */
> -#if OS(WINDOWS)
> -#define USE_QUERY_PERFORMANCE_COUNTER  1
> -#endif

So the assumption is that nobody on Windows has a reason to turn this off? I suppose we should mention that in the ChangeLog.
Comment 3 Philip Chimento 2022-01-06 15:54:32 PST
Comment on attachment 448273 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=448273&action=review

Looks good!

> Source/WTF/wtf/CurrentTime.cpp:201
> +    return static_cast<Int128>(currentTime() * 1000000000);

No idea if the WebKit coding style encourages or discourages this, but I usually prefer to include numeric separators, like 1'000'000'000, it makes it easier to see at a glance if there is a typo in the number of digits!
Comment 4 Radar WebKit Bug Importer 2022-01-11 01:12:16 PST
<rdar://problem/87385546>
Comment 5 Yusuke Suzuki 2022-01-19 21:55:55 PST
Comment on attachment 448273 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=448273&action=review

>> Source/WTF/wtf/CurrentTime.cpp:201
>> +    return static_cast<Int128>(currentTime() * 1000000000);
> 
> No idea if the WebKit coding style encourages or discourages this, but I usually prefer to include numeric separators, like 1'000'000'000, it makes it easier to see at a glance if there is a typo in the number of digits!

Changed.
Comment 6 Yusuke Suzuki 2022-01-19 21:56:13 PST
Comment on attachment 448273 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=448273&action=review

>> Source/WTF/wtf/PlatformUse.h:-92
>> -#endif
> 
> So the assumption is that nobody on Windows has a reason to turn this off? I suppose we should mention that in the ChangeLog.

Yes. Added.
Comment 7 Yusuke Suzuki 2022-01-19 22:02:03 PST
Committed r288272 (246212@trunk): <https://commits.webkit.org/246212@trunk>