| 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 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 // Forward declarations. | 13 // Forward declarations. |
| 14 class DebugInfo; | 14 class DebugInfo; |
| 15 class Isolate; | 15 class Isolate; |
| 16 class LocalHandle; | 16 class LocalHandle; |
| 17 class RawError; | 17 class RawError; |
| 18 class ReadOnlyHandles; | 18 class ReadOnlyHandles; |
| 19 class ThreadPool; | 19 class ThreadPool; |
| 20 | 20 |
| 21 class Dart : public AllStatic { | 21 class Dart : public AllStatic { |
| 22 public: | 22 public: |
| 23 static const char* InitOnce( | 23 static const char* InitOnce( |
| 24 const uint8_t* vm_isolate_snapshot, | 24 const uint8_t* vm_isolate_snapshot, |
| 25 const uint8_t* instructions_snapshot, | 25 const uint8_t* instructions_snapshot, |
| 26 const uint8_t* data_snapshot, |
| 26 Dart_IsolateCreateCallback create, | 27 Dart_IsolateCreateCallback create, |
| 27 Dart_IsolateShutdownCallback shutdown, | 28 Dart_IsolateShutdownCallback shutdown, |
| 28 Dart_FileOpenCallback file_open, | 29 Dart_FileOpenCallback file_open, |
| 29 Dart_FileReadCallback file_read, | 30 Dart_FileReadCallback file_read, |
| 30 Dart_FileWriteCallback file_write, | 31 Dart_FileWriteCallback file_write, |
| 31 Dart_FileCloseCallback file_close, | 32 Dart_FileCloseCallback file_close, |
| 32 Dart_EntropySource entropy_source, | 33 Dart_EntropySource entropy_source, |
| 33 Dart_GetVMServiceAssetsArchive get_service_assets); | 34 Dart_GetVMServiceAssetsArchive get_service_assets); |
| 34 static const char* Cleanup(); | 35 static const char* Cleanup(); |
| 35 | 36 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 57 static const uint8_t* instructions_snapshot_buffer() { | 58 static const uint8_t* instructions_snapshot_buffer() { |
| 58 return instructions_snapshot_buffer_; | 59 return instructions_snapshot_buffer_; |
| 59 } | 60 } |
| 60 static void set_instructions_snapshot_buffer(const uint8_t* buffer) { | 61 static void set_instructions_snapshot_buffer(const uint8_t* buffer) { |
| 61 instructions_snapshot_buffer_ = buffer; | 62 instructions_snapshot_buffer_ = buffer; |
| 62 } | 63 } |
| 63 static bool IsRunningPrecompiledCode() { | 64 static bool IsRunningPrecompiledCode() { |
| 64 return instructions_snapshot_buffer_ != NULL; | 65 return instructions_snapshot_buffer_ != NULL; |
| 65 } | 66 } |
| 66 | 67 |
| 68 static const uint8_t* data_snapshot_buffer() { |
| 69 return data_snapshot_buffer_; |
| 70 } |
| 71 static void set_data_snapshot_buffer(const uint8_t* buffer) { |
| 72 data_snapshot_buffer_ = buffer; |
| 73 } |
| 74 |
| 67 private: | 75 private: |
| 68 static void WaitForIsolateShutdown(); | 76 static void WaitForIsolateShutdown(); |
| 69 | 77 |
| 70 static Isolate* vm_isolate_; | 78 static Isolate* vm_isolate_; |
| 71 static ThreadPool* thread_pool_; | 79 static ThreadPool* thread_pool_; |
| 72 static DebugInfo* pprof_symbol_generator_; | 80 static DebugInfo* pprof_symbol_generator_; |
| 73 static ReadOnlyHandles* predefined_handles_; | 81 static ReadOnlyHandles* predefined_handles_; |
| 74 static const uint8_t* instructions_snapshot_buffer_; | 82 static const uint8_t* instructions_snapshot_buffer_; |
| 83 static const uint8_t* data_snapshot_buffer_; |
| 75 }; | 84 }; |
| 76 | 85 |
| 77 } // namespace dart | 86 } // namespace dart |
| 78 | 87 |
| 79 #endif // VM_DART_H_ | 88 #endif // VM_DART_H_ |
| OLD | NEW |