Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 7c1230032c5e2b660c114d20da2d5e712b77b31a..736741861dd00b570d435eb5bb47c1fc60c1f999 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -290,9 +290,18 @@ int PerIsolateData::RealmIndexOrThrow( |
#ifndef V8_SHARED |
// performance.now() returns a time stamp as double, measured in milliseconds. |
+// When FLAG_verify_predictable mode is enabled it returns current value |
+// of Heap::allocations_count(). |
void Shell::PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args) { |
- i::TimeDelta delta = i::TimeTicks::HighResolutionNow() - kInitialTicks; |
- args.GetReturnValue().Set(delta.InMillisecondsF()); |
+ if (i::FLAG_verify_predictable) { |
+ Isolate* v8_isolate = args.GetIsolate(); |
+ i::Heap* heap = reinterpret_cast<i::Isolate*>(v8_isolate)->heap(); |
+ args.GetReturnValue().Set(heap->synthetic_time()); |
+ |
+ } else { |
+ i::TimeDelta delta = i::TimeTicks::HighResolutionNow() - kInitialTicks; |
+ args.GetReturnValue().Set(delta.InMillisecondsF()); |
+ } |
} |
#endif // !V8_SHARED |