Commit 7f607cfd authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

Reland "[foozzie] Suppress access to CurrentTimeValue"

This is a reland of e26863df

The test now works with the no-i18n case.

Original change's description:
> [foozzie] Suppress access to CurrentTimeValue
>
> This stubs out CurrentTimeValue for differential fuzzing as otherwise
> the non-deterministic value leaks from Intl.DateTimeFormat format and
> formatToParts.
>
> This also affects other date creations, like Date.now(), which is
> already stubbed out on the JS side. We keep that code for
> backwards-compatibility to keep bisection stable.
>
> Bug: chromium:1149050
> Change-Id: Ifd82844c9fb8ce7262b55da6cf9f88f544268942
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2546685
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71294}

Cq-Include-Trybots: luci.v8.try.triggered:v8_linux_noi18n_rel_ng_triggered
Bug: chromium:1149050
Change-Id: I4a750b580495532ca0ffb125522f8f5958e4cad6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2552401
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71309}
parent 31005b5c
......@@ -5090,6 +5090,7 @@ MaybeHandle<JSDate> JSDate::New(Handle<JSFunction> constructor,
// static
double JSDate::CurrentTimeValue(Isolate* isolate) {
if (FLAG_log_internal_timer_events) LOG(isolate, CurrentTimeEvent());
if (FLAG_correctness_fuzzer_suppressions) return 4.2;
// According to ECMA-262, section 15.9.1, page 117, the precision of
// the number in a Date object representing a particular instant in
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
// Flags: --allow-natives-syntax --correctness-fuzzer-suppressions
// Files: tools/clusterfuzz/v8_mock.js
// Test foozzie mocks for differential fuzzing.
......@@ -22,6 +22,13 @@ assertEquals(710, new Date.prototype.constructor().getUTCMilliseconds());
assertEquals(819134640000,
new Date('December 17, 1995 03:24:00 GMT+1000').getTime());
// Deterministic DateTimeFormat.
if (this.Intl) {
const df = new Intl.DateTimeFormat(undefined, {fractionalSecondDigits: 3});
assertEquals('004', df.format());
assertEquals('004', df.formatToParts()[0].value);
}
// Dummy performance methods.
assertEquals(1.2, performance.now());
assertEquals([], performance.measureMemory());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment