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

Side by Side Diff: src/d8.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 unified diff | Download patch
« no previous file with comments | « no previous file | src/execution.cc » ('j') | src/libplatform/default-platform.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 // Defined when linking against shared lib on Windows. 6 // Defined when linking against shared lib on Windows.
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED)
8 #define V8_SHARED 8 #define V8_SHARED
9 #endif 9 #endif
10 10
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 return index; 422 return index;
423 } 423 }
424 424
425 425
426 #ifndef V8_SHARED 426 #ifndef V8_SHARED
427 // performance.now() returns a time stamp as double, measured in milliseconds. 427 // performance.now() returns a time stamp as double, measured in milliseconds.
428 // When FLAG_verify_predictable mode is enabled it returns current value 428 // When FLAG_verify_predictable mode is enabled it returns current value
429 // of Heap::allocations_count(). 429 // of Heap::allocations_count().
430 void Shell::PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args) { 430 void Shell::PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args) {
431 if (i::FLAG_verify_predictable) { 431 if (i::FLAG_verify_predictable) {
432 Isolate* v8_isolate = args.GetIsolate(); 432 args.GetReturnValue().Set(g_platform->MonotonicallyIncreasingTime());
433 i::Heap* heap = reinterpret_cast<i::Isolate*>(v8_isolate)->heap();
434 args.GetReturnValue().Set(heap->synthetic_time());
435 } else { 433 } else {
436 base::TimeDelta delta = 434 base::TimeDelta delta =
437 base::TimeTicks::HighResolutionNow() - kInitialTicks; 435 base::TimeTicks::HighResolutionNow() - kInitialTicks;
438 args.GetReturnValue().Set(delta.InMillisecondsF()); 436 args.GetReturnValue().Set(delta.InMillisecondsF());
439 } 437 }
440 } 438 }
441 #endif // !V8_SHARED 439 #endif // !V8_SHARED
442 440
443 441
444 // Realm.current() returns the index of the currently active realm. 442 // Realm.current() returns the index of the currently active realm.
(...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 } 2474 }
2477 2475
2478 } // namespace v8 2476 } // namespace v8
2479 2477
2480 2478
2481 #ifndef GOOGLE3 2479 #ifndef GOOGLE3
2482 int main(int argc, char* argv[]) { 2480 int main(int argc, char* argv[]) {
2483 return v8::Shell::Main(argc, argv); 2481 return v8::Shell::Main(argc, argv);
2484 } 2482 }
2485 #endif 2483 #endif
OLDNEW
« no previous file with comments | « no previous file | src/execution.cc » ('j') | src/libplatform/default-platform.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698