-
Frank Tang authored
TotalDurationNanoseconds previously return a double to represent the total duration nanoseconds, but the value could be easily bigger than the precise value a double can represent. A double can precisely represent integer to 2^53, which is only about 104 days if that value is nanoseconds. So we need to change the return type to BigInt. Refactor BalanceDuration to merge common code. Change JSTemporalDuration::Compare to use the BigInt version of TotalDurationNanoseconds Change the call site of TotalDurationNanoseconds in RoundDuration Add newly defined BalancePossiblyInfiniteDuration and change BalanceDuration to call it. Spec text: https://tc39.es/proposal-temporal/#sec-temporal-balancepossiblyinfiniteduration https://tc39.es/proposal-temporal/#sec-temporal-balanceduration https://tc39.es/proposal-temporal/#sec-temporal-totaldurationnanoseconds Split from changes in cl/3750098 Bug: v8:11544 Change-Id: Ia4ca8f9bdba49c3a5e54edeef0d2a5833b0002a2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3824658Reviewed-by: Adam Klein <adamk@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/main@{#82475}
20f23206