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 RawError; | 16 class RawError; |
| 17 class ReadOnlyHandles; |
17 class ThreadPool; | 18 class ThreadPool; |
18 | 19 |
19 class Dart : public AllStatic { | 20 class Dart : public AllStatic { |
20 public: | 21 public: |
21 static const char* InitOnce( | 22 static const char* InitOnce( |
22 Dart_IsolateCreateCallback create, | 23 Dart_IsolateCreateCallback create, |
23 Dart_IsolateInterruptCallback interrupt, | 24 Dart_IsolateInterruptCallback interrupt, |
24 Dart_IsolateUnhandledExceptionCallback unhandled, | 25 Dart_IsolateUnhandledExceptionCallback unhandled, |
25 Dart_IsolateShutdownCallback shutdown, | 26 Dart_IsolateShutdownCallback shutdown, |
26 Dart_FileOpenCallback file_open, | 27 Dart_FileOpenCallback file_open, |
27 Dart_FileWriteCallback file_write, | 28 Dart_FileWriteCallback file_write, |
28 Dart_FileCloseCallback file_close); | 29 Dart_FileCloseCallback file_close); |
29 | 30 |
30 static Isolate* CreateIsolate(const char* name_prefix); | 31 static Isolate* CreateIsolate(const char* name_prefix); |
31 static RawError* InitializeIsolate(const uint8_t* snapshot, void* data); | 32 static RawError* InitializeIsolate(const uint8_t* snapshot, void* data); |
32 static void ShutdownIsolate(); | 33 static void ShutdownIsolate(); |
33 | 34 |
34 static Isolate* vm_isolate() { return vm_isolate_; } | 35 static Isolate* vm_isolate() { return vm_isolate_; } |
35 static ThreadPool* thread_pool() { return thread_pool_; } | 36 static ThreadPool* thread_pool() { return thread_pool_; } |
36 | 37 |
37 static void set_pprof_symbol_generator(DebugInfo* value) { | 38 static void set_pprof_symbol_generator(DebugInfo* value) { |
38 pprof_symbol_generator_ = value; | 39 pprof_symbol_generator_ = value; |
39 } | 40 } |
40 static DebugInfo* pprof_symbol_generator() { return pprof_symbol_generator_; } | 41 static DebugInfo* pprof_symbol_generator() { return pprof_symbol_generator_; } |
41 | 42 |
| 43 static uword AllocateReadOnlyHandle(); |
| 44 static bool IsReadOnlyHandle(uword address); |
| 45 |
42 private: | 46 private: |
43 static Isolate* vm_isolate_; | 47 static Isolate* vm_isolate_; |
44 static ThreadPool* thread_pool_; | 48 static ThreadPool* thread_pool_; |
45 static DebugInfo* pprof_symbol_generator_; | 49 static DebugInfo* pprof_symbol_generator_; |
| 50 static ReadOnlyHandles* predefined_handles_; |
46 }; | 51 }; |
47 | 52 |
48 } // namespace dart | 53 } // namespace dart |
49 | 54 |
50 #endif // VM_DART_H_ | 55 #endif // VM_DART_H_ |
OLD | NEW |