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