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

Side by Side Diff: src/d8.cc

Issue 460413002: Fix predictable mode to make time pass faster. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 325
326 #ifndef V8_SHARED 326 #ifndef V8_SHARED
327 // performance.now() returns a time stamp as double, measured in milliseconds. 327 // performance.now() returns a time stamp as double, measured in milliseconds.
328 // When FLAG_verify_predictable mode is enabled it returns current value 328 // When FLAG_verify_predictable mode is enabled it returns current value
329 // of Heap::allocations_count(). 329 // of Heap::allocations_count().
330 void Shell::PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args) { 330 void Shell::PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args) {
331 if (i::FLAG_verify_predictable) { 331 if (i::FLAG_verify_predictable) {
332 Isolate* v8_isolate = args.GetIsolate(); 332 Isolate* v8_isolate = args.GetIsolate();
333 i::Heap* heap = reinterpret_cast<i::Isolate*>(v8_isolate)->heap(); 333 i::Heap* heap = reinterpret_cast<i::Isolate*>(v8_isolate)->heap();
334 args.GetReturnValue().Set(heap->synthetic_time()); 334 args.GetReturnValue().Set(heap->synthetic_time());
335
336 } else { 335 } else {
337 base::TimeDelta delta = 336 base::TimeDelta delta =
338 base::TimeTicks::HighResolutionNow() - kInitialTicks; 337 base::TimeTicks::HighResolutionNow() - kInitialTicks;
339 args.GetReturnValue().Set(delta.InMillisecondsF()); 338 args.GetReturnValue().Set(delta.InMillisecondsF());
340 } 339 }
341 } 340 }
342 #endif // !V8_SHARED 341 #endif // !V8_SHARED
343 342
344 343
345 // Realm.current() returns the index of the currently active realm. 344 // Realm.current() returns the index of the currently active realm.
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 } 1690 }
1692 1691
1693 } // namespace v8 1692 } // namespace v8
1694 1693
1695 1694
1696 #ifndef GOOGLE3 1695 #ifndef GOOGLE3
1697 int main(int argc, char* argv[]) { 1696 int main(int argc, char* argv[]) {
1698 return v8::Shell::Main(argc, argv); 1697 return v8::Shell::Main(argc, argv);
1699 } 1698 }
1700 #endif 1699 #endif
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698