| 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 VM_DART_H_ | 5 #ifndef VM_DART_H_ |
| 6 #define VM_DART_H_ | 6 #define 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 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 static Isolate* CreateIsolate(const char* name_prefix, | 36 static Isolate* CreateIsolate(const char* name_prefix, |
| 37 const Dart_IsolateFlags& api_flags); | 37 const Dart_IsolateFlags& api_flags); |
| 38 static RawError* InitializeIsolate(const uint8_t* snapshot, void* data); | 38 static RawError* InitializeIsolate(const uint8_t* snapshot, void* data); |
| 39 static void RunShutdownCallback(); | 39 static void RunShutdownCallback(); |
| 40 static void ShutdownIsolate(Isolate* isolate); | 40 static void ShutdownIsolate(Isolate* isolate); |
| 41 static void ShutdownIsolate(); | 41 static void ShutdownIsolate(); |
| 42 | 42 |
| 43 static Isolate* vm_isolate() { return vm_isolate_; } | 43 static Isolate* vm_isolate() { return vm_isolate_; } |
| 44 static ThreadPool* thread_pool() { return thread_pool_; } | 44 static ThreadPool* thread_pool() { return thread_pool_; } |
| 45 | 45 |
| 46 // Returns a timestamp for use in debugging output in milliseconds |
| 47 // since start time. |
| 48 static int64_t timestamp(); |
| 49 |
| 46 static void set_pprof_symbol_generator(DebugInfo* value) { | 50 static void set_pprof_symbol_generator(DebugInfo* value) { |
| 47 pprof_symbol_generator_ = value; | 51 pprof_symbol_generator_ = value; |
| 48 } | 52 } |
| 49 static DebugInfo* pprof_symbol_generator() { return pprof_symbol_generator_; } | 53 static DebugInfo* pprof_symbol_generator() { return pprof_symbol_generator_; } |
| 50 | 54 |
| 51 static LocalHandle* AllocateReadOnlyApiHandle(); | 55 static LocalHandle* AllocateReadOnlyApiHandle(); |
| 52 static bool IsReadOnlyApiHandle(Dart_Handle handle); | 56 static bool IsReadOnlyApiHandle(Dart_Handle handle); |
| 53 | 57 |
| 54 static uword AllocateReadOnlyHandle(); | 58 static uword AllocateReadOnlyHandle(); |
| 55 static bool IsReadOnlyHandle(uword address); | 59 static bool IsReadOnlyHandle(uword address); |
| 56 | 60 |
| 57 static const uint8_t* instructions_snapshot_buffer() { | 61 static const uint8_t* instructions_snapshot_buffer() { |
| 58 return instructions_snapshot_buffer_; | 62 return instructions_snapshot_buffer_; |
| 59 } | 63 } |
| 60 static void set_instructions_snapshot_buffer(const uint8_t* buffer) { | 64 static void set_instructions_snapshot_buffer(const uint8_t* buffer) { |
| 61 instructions_snapshot_buffer_ = buffer; | 65 instructions_snapshot_buffer_ = buffer; |
| 62 } | 66 } |
| 63 static bool IsRunningPrecompiledCode() { | 67 static bool IsRunningPrecompiledCode() { |
| 64 return instructions_snapshot_buffer_ != NULL; | 68 return instructions_snapshot_buffer_ != NULL; |
| 65 } | 69 } |
| 66 | 70 |
| 67 private: | 71 private: |
| 68 static void WaitForIsolateShutdown(); | 72 static void WaitForIsolateShutdown(); |
| 69 | 73 |
| 70 static Isolate* vm_isolate_; | 74 static Isolate* vm_isolate_; |
| 75 static int64_t start_time_; |
| 71 static ThreadPool* thread_pool_; | 76 static ThreadPool* thread_pool_; |
| 72 static DebugInfo* pprof_symbol_generator_; | 77 static DebugInfo* pprof_symbol_generator_; |
| 73 static ReadOnlyHandles* predefined_handles_; | 78 static ReadOnlyHandles* predefined_handles_; |
| 74 static const uint8_t* instructions_snapshot_buffer_; | 79 static const uint8_t* instructions_snapshot_buffer_; |
| 75 }; | 80 }; |
| 76 | 81 |
| 77 } // namespace dart | 82 } // namespace dart |
| 78 | 83 |
| 79 #endif // VM_DART_H_ | 84 #endif // VM_DART_H_ |
| OLD | NEW |