Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Unified Diff: src/runtime.cc

Issue 325553002: --verify-predictable mode added for ensuring that GC behaves deterministically. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index a824d6a7977c34fbd0f6508c3dd4779193a56fa5..9edb476d5f74d005cce16bec43f9598e24ca8dad 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -9640,7 +9640,13 @@ RUNTIME_FUNCTION(Runtime_DateCurrentTime) {
// the number in a Date object representing a particular instant in
// time is milliseconds. Therefore, we floor the result of getting
// the OS time.
- double millis = std::floor(OS::TimeCurrentMillis());
+ double millis;
+ if (FLAG_verify_predictable) {
+ millis = 1388534400000.0; // Jan 1 2014 00:00:00 GMT+0000
+ millis += std::floor(isolate->heap()->allocations_count());
+ } else {
+ millis = std::floor(OS::TimeCurrentMillis());
+ }
return *isolate->factory()->NewNumber(millis);
}

Powered by Google App Engine
This is Rietveld 408576698