| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |