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

Unified Diff: src/libplatform/default-platform.cc

Issue 1415383004: Fixing --verify-predictable mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « src/libplatform/default-platform.h ('k') | src/runtime/runtime-date.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/libplatform/default-platform.cc
diff --git a/src/libplatform/default-platform.cc b/src/libplatform/default-platform.cc
index 383d8ce1e0dc2d9394521cbc9ce5677890e7674f..dbaec736e8b61e0999cee834910268d37c1cdbaf 100644
--- a/src/libplatform/default-platform.cc
+++ b/src/libplatform/default-platform.cc
@@ -11,6 +11,7 @@
#include "src/base/platform/platform.h"
#include "src/base/platform/time.h"
#include "src/base/sys-info.h"
+#include "src/flags.h"
Igor Sheludko 2015/11/10 10:41:06 Unfortunately this violates "-src" directive from
#include "src/libplatform/worker-thread.h"
namespace v8 {
@@ -34,7 +35,7 @@ const int DefaultPlatform::kMaxThreadPoolSize = 4;
DefaultPlatform::DefaultPlatform()
- : initialized_(false), thread_pool_size_(0) {}
+ : initialized_(false), thread_pool_size_(0), synthetic_time_in_sec_(0.0) {}
DefaultPlatform::~DefaultPlatform() {
@@ -165,6 +166,11 @@ bool DefaultPlatform::IdleTasksEnabled(Isolate* isolate) { return false; }
double DefaultPlatform::MonotonicallyIncreasingTime() {
+ if (v8::internal::FLAG_verify_predictable) {
Igor Sheludko 2015/11/10 10:41:06 We could probably make FLAG_verify_predictable rea
jochen (gone - plz use gerrit) 2015/11/10 23:20:06 we can't rely on every embedder doing this. how ab
Igor Sheludko 2015/11/11 10:20:46 1) The VERIFY_PREDICTABLE (and then --verify-predi
+ synthetic_time_in_sec_ += 0.000001;
+ return synthetic_time_in_sec_;
+ }
+
return base::TimeTicks::HighResolutionNow().ToInternalValue() /
static_cast<double>(base::Time::kMicrosecondsPerSecond);
}
« no previous file with comments | « src/libplatform/default-platform.h ('k') | src/runtime/runtime-date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698