| 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 #include "vm/snapshot.h" |
| 10 | 11 |
| 11 namespace dart { | 12 namespace dart { |
| 12 | 13 |
| 13 // Forward declarations. | 14 // Forward declarations. |
| 14 class DebugInfo; | 15 class DebugInfo; |
| 15 class Isolate; | 16 class Isolate; |
| 16 class LocalHandle; | 17 class LocalHandle; |
| 17 class RawError; | 18 class RawError; |
| 18 class ReadOnlyHandles; | 19 class ReadOnlyHandles; |
| 19 class ThreadPool; | 20 class ThreadPool; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 pprof_symbol_generator_ = value; | 54 pprof_symbol_generator_ = value; |
| 54 } | 55 } |
| 55 static DebugInfo* pprof_symbol_generator() { return pprof_symbol_generator_; } | 56 static DebugInfo* pprof_symbol_generator() { return pprof_symbol_generator_; } |
| 56 | 57 |
| 57 static LocalHandle* AllocateReadOnlyApiHandle(); | 58 static LocalHandle* AllocateReadOnlyApiHandle(); |
| 58 static bool IsReadOnlyApiHandle(Dart_Handle handle); | 59 static bool IsReadOnlyApiHandle(Dart_Handle handle); |
| 59 | 60 |
| 60 static uword AllocateReadOnlyHandle(); | 61 static uword AllocateReadOnlyHandle(); |
| 61 static bool IsReadOnlyHandle(uword address); | 62 static bool IsReadOnlyHandle(uword address); |
| 62 | 63 |
| 64 static Snapshot::Kind snapshot_kind() { |
| 65 return snapshot_kind_; |
| 66 } |
| 63 static const uint8_t* instructions_snapshot_buffer() { | 67 static const uint8_t* instructions_snapshot_buffer() { |
| 64 return instructions_snapshot_buffer_; | 68 return instructions_snapshot_buffer_; |
| 65 } | 69 } |
| 66 static void set_instructions_snapshot_buffer(const uint8_t* buffer) { | 70 static void set_instructions_snapshot_buffer(const uint8_t* buffer) { |
| 67 instructions_snapshot_buffer_ = buffer; | 71 instructions_snapshot_buffer_ = buffer; |
| 68 } | 72 } |
| 69 static bool IsRunningPrecompiledCode() { | |
| 70 return instructions_snapshot_buffer_ != NULL; | |
| 71 } | |
| 72 | |
| 73 static const uint8_t* data_snapshot_buffer() { | 73 static const uint8_t* data_snapshot_buffer() { |
| 74 return data_snapshot_buffer_; | 74 return data_snapshot_buffer_; |
| 75 } | 75 } |
| 76 static void set_data_snapshot_buffer(const uint8_t* buffer) { | 76 static void set_data_snapshot_buffer(const uint8_t* buffer) { |
| 77 data_snapshot_buffer_ = buffer; | 77 data_snapshot_buffer_ = buffer; |
| 78 } | 78 } |
| 79 | 79 |
| 80 static Dart_ThreadExitCallback thread_exit_callback() { | 80 static Dart_ThreadExitCallback thread_exit_callback() { |
| 81 return thread_exit_callback_; | 81 return thread_exit_callback_; |
| 82 } | 82 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 static void WaitForIsolateShutdown(); | 117 static void WaitForIsolateShutdown(); |
| 118 | 118 |
| 119 static Isolate* vm_isolate_; | 119 static Isolate* vm_isolate_; |
| 120 static int64_t start_time_; | 120 static int64_t start_time_; |
| 121 static ThreadPool* thread_pool_; | 121 static ThreadPool* thread_pool_; |
| 122 static DebugInfo* pprof_symbol_generator_; | 122 static DebugInfo* pprof_symbol_generator_; |
| 123 static ReadOnlyHandles* predefined_handles_; | 123 static ReadOnlyHandles* predefined_handles_; |
| 124 static Snapshot::Kind snapshot_kind_; |
| 124 static const uint8_t* instructions_snapshot_buffer_; | 125 static const uint8_t* instructions_snapshot_buffer_; |
| 125 static const uint8_t* data_snapshot_buffer_; | 126 static const uint8_t* data_snapshot_buffer_; |
| 126 static Dart_ThreadExitCallback thread_exit_callback_; | 127 static Dart_ThreadExitCallback thread_exit_callback_; |
| 127 static Dart_FileOpenCallback file_open_callback_; | 128 static Dart_FileOpenCallback file_open_callback_; |
| 128 static Dart_FileReadCallback file_read_callback_; | 129 static Dart_FileReadCallback file_read_callback_; |
| 129 static Dart_FileWriteCallback file_write_callback_; | 130 static Dart_FileWriteCallback file_write_callback_; |
| 130 static Dart_FileCloseCallback file_close_callback_; | 131 static Dart_FileCloseCallback file_close_callback_; |
| 131 static Dart_EntropySource entropy_source_callback_; | 132 static Dart_EntropySource entropy_source_callback_; |
| 132 }; | 133 }; |
| 133 | 134 |
| 134 } // namespace dart | 135 } // namespace dart |
| 135 | 136 |
| 136 #endif // VM_DART_H_ | 137 #endif // VM_DART_H_ |
| OLD | NEW |