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

Side by Side Diff: runtime/vm/dart.h

Issue 2583663002: Internally measure isolate uptime with monotonic time. (Closed)
Patch Set: Created 4 years 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 | runtime/vm/dart.cc » ('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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_DART_H_ 5 #ifndef RUNTIME_VM_DART_H_
6 #define RUNTIME_VM_DART_H_ 6 #define RUNTIME_VM_DART_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/snapshot.h" 10 #include "vm/snapshot.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 intptr_t snapshot_length, 49 intptr_t snapshot_length,
50 kernel::Program* kernel_program, 50 kernel::Program* kernel_program,
51 void* data); 51 void* data);
52 static void RunShutdownCallback(); 52 static void RunShutdownCallback();
53 static void ShutdownIsolate(Isolate* isolate); 53 static void ShutdownIsolate(Isolate* isolate);
54 static void ShutdownIsolate(); 54 static void ShutdownIsolate();
55 55
56 static Isolate* vm_isolate() { return vm_isolate_; } 56 static Isolate* vm_isolate() { return vm_isolate_; }
57 static ThreadPool* thread_pool() { return thread_pool_; } 57 static ThreadPool* thread_pool() { return thread_pool_; }
58 58
59 // Returns a timestamp for use in debugging output in milliseconds 59 static int64_t UptimeMicros();
60 // since start time. 60 static int64_t UptimeMillis() {
61 static int64_t timestamp(); 61 return UptimeMicros() / kMicrosecondsPerMillisecond;
62 }
62 63
63 static void set_pprof_symbol_generator(DebugInfo* value) { 64 static void set_pprof_symbol_generator(DebugInfo* value) {
64 pprof_symbol_generator_ = value; 65 pprof_symbol_generator_ = value;
65 } 66 }
66 static DebugInfo* pprof_symbol_generator() { return pprof_symbol_generator_; } 67 static DebugInfo* pprof_symbol_generator() { return pprof_symbol_generator_; }
67 68
68 static LocalHandle* AllocateReadOnlyApiHandle(); 69 static LocalHandle* AllocateReadOnlyApiHandle();
69 static bool IsReadOnlyApiHandle(Dart_Handle handle); 70 static bool IsReadOnlyApiHandle(Dart_Handle handle);
70 71
71 static uword AllocateReadOnlyHandle(); 72 static uword AllocateReadOnlyHandle();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 120 }
120 static Dart_EntropySource entropy_source_callback() { 121 static Dart_EntropySource entropy_source_callback() {
121 return entropy_source_callback_; 122 return entropy_source_callback_;
122 } 123 }
123 124
124 private: 125 private:
125 static void WaitForIsolateShutdown(); 126 static void WaitForIsolateShutdown();
126 static void WaitForApplicationIsolateShutdown(); 127 static void WaitForApplicationIsolateShutdown();
127 128
128 static Isolate* vm_isolate_; 129 static Isolate* vm_isolate_;
129 static int64_t start_time_; 130 static int64_t start_time_micros_;
130 static ThreadPool* thread_pool_; 131 static ThreadPool* thread_pool_;
131 static DebugInfo* pprof_symbol_generator_; 132 static DebugInfo* pprof_symbol_generator_;
132 static ReadOnlyHandles* predefined_handles_; 133 static ReadOnlyHandles* predefined_handles_;
133 static Snapshot::Kind snapshot_kind_; 134 static Snapshot::Kind snapshot_kind_;
134 static const uint8_t* instructions_snapshot_buffer_; 135 static const uint8_t* instructions_snapshot_buffer_;
135 static const uint8_t* data_snapshot_buffer_; 136 static const uint8_t* data_snapshot_buffer_;
136 static Dart_ThreadExitCallback thread_exit_callback_; 137 static Dart_ThreadExitCallback thread_exit_callback_;
137 static Dart_FileOpenCallback file_open_callback_; 138 static Dart_FileOpenCallback file_open_callback_;
138 static Dart_FileReadCallback file_read_callback_; 139 static Dart_FileReadCallback file_read_callback_;
139 static Dart_FileWriteCallback file_write_callback_; 140 static Dart_FileWriteCallback file_write_callback_;
140 static Dart_FileCloseCallback file_close_callback_; 141 static Dart_FileCloseCallback file_close_callback_;
141 static Dart_EntropySource entropy_source_callback_; 142 static Dart_EntropySource entropy_source_callback_;
142 }; 143 };
143 144
144 } // namespace dart 145 } // namespace dart
145 146
146 #endif // RUNTIME_VM_DART_H_ 147 #endif // RUNTIME_VM_DART_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698