Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 7c1230032c5e2b660c114d20da2d5e712b77b31a..3b8c1cafbdca2c0b2c1d5f70795351a2928f20c0 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -291,8 +291,15 @@ int PerIsolateData::RealmIndexOrThrow( |
#ifndef V8_SHARED |
// performance.now() returns a time stamp as double, measured in milliseconds. |
Hannes Payer (out of office)
2014/06/09 15:23:51
Please adjust the comment, i.e. say what it return
Igor Sheludko
2014/06/10 08:22:54
Done.
|
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(static_cast<double>(heap->allocations_count())); |
+ |
+ } else { |
+ i::TimeDelta delta = i::TimeTicks::HighResolutionNow() - kInitialTicks; |
+ args.GetReturnValue().Set(delta.InMillisecondsF()); |
+ } |
} |
#endif // !V8_SHARED |