Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Side by Side Diff: runtime/vm/dart.h

Issue 2525623002: VM: [Kernel] Split kernel API into 3 steps: ([read binary], parse-binary, bootstrap, load program) (Closed)
Patch Set: addressed comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/bootstrap_nocore.cc ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 11
12 namespace dart { 12 namespace dart {
13 13
14 // Forward declarations. 14 // Forward declarations.
15 class DebugInfo; 15 class DebugInfo;
16 class Isolate; 16 class Isolate;
17 class LocalHandle; 17 class LocalHandle;
18 class RawError; 18 class RawError;
19 class ReadOnlyHandles; 19 class ReadOnlyHandles;
20 class ThreadPool; 20 class ThreadPool;
21 namespace kernel {
22 class Program;
23 }
21 24
22 class Dart : public AllStatic { 25 class Dart : public AllStatic {
23 public: 26 public:
24 static char* InitOnce(const uint8_t* vm_isolate_snapshot, 27 static char* InitOnce(const uint8_t* vm_isolate_snapshot,
25 const uint8_t* instructions_snapshot, 28 const uint8_t* instructions_snapshot,
26 const uint8_t* data_snapshot, 29 const uint8_t* data_snapshot,
27 Dart_IsolateCreateCallback create, 30 Dart_IsolateCreateCallback create,
28 Dart_IsolateShutdownCallback shutdown, 31 Dart_IsolateShutdownCallback shutdown,
29 Dart_ThreadExitCallback thread_exit, 32 Dart_ThreadExitCallback thread_exit,
30 Dart_FileOpenCallback file_open, 33 Dart_FileOpenCallback file_open,
31 Dart_FileReadCallback file_read, 34 Dart_FileReadCallback file_read,
32 Dart_FileWriteCallback file_write, 35 Dart_FileWriteCallback file_write,
33 Dart_FileCloseCallback file_close, 36 Dart_FileCloseCallback file_close,
34 Dart_EntropySource entropy_source, 37 Dart_EntropySource entropy_source,
35 Dart_GetVMServiceAssetsArchive get_service_assets); 38 Dart_GetVMServiceAssetsArchive get_service_assets);
36 static const char* Cleanup(); 39 static const char* Cleanup();
37 40
38 static Isolate* CreateIsolate(const char* name_prefix, 41 static Isolate* CreateIsolate(const char* name_prefix,
39 const Dart_IsolateFlags& api_flags); 42 const Dart_IsolateFlags& api_flags);
40 43
41 // Initialize an isolate, either from a snapshot, from a Kernel binary, or 44 // Initialize an isolate, either from a snapshot, from a Kernel binary, or
42 // from SDK library sources. If the snapshot_buffer is non-NULL, 45 // from SDK library sources. If the snapshot_buffer is non-NULL,
43 // initialize from a snapshot or a Kernel binary depending on the value of 46 // initialize from a snapshot or a Kernel binary depending on the value of
44 // from_kernel. Otherwise, initialize from sources. 47 // from_kernel. Otherwise, initialize from sources.
45 static RawError* InitializeIsolate(const uint8_t* snapshot_buffer, 48 static RawError* InitializeIsolate(const uint8_t* snapshot_buffer,
46 intptr_t snapshot_length, 49 intptr_t snapshot_length,
47 bool from_kernel, 50 kernel::Program* kernel_program,
48 void* data); 51 void* data);
49 static void RunShutdownCallback(); 52 static void RunShutdownCallback();
50 static void ShutdownIsolate(Isolate* isolate); 53 static void ShutdownIsolate(Isolate* isolate);
51 static void ShutdownIsolate(); 54 static void ShutdownIsolate();
52 55
53 static Isolate* vm_isolate() { return vm_isolate_; } 56 static Isolate* vm_isolate() { return vm_isolate_; }
54 static ThreadPool* thread_pool() { return thread_pool_; } 57 static ThreadPool* thread_pool() { return thread_pool_; }
55 58
56 // Returns a timestamp for use in debugging output in milliseconds 59 // Returns a timestamp for use in debugging output in milliseconds
57 // since start time. 60 // since start time.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 static Dart_FileOpenCallback file_open_callback_; 137 static Dart_FileOpenCallback file_open_callback_;
135 static Dart_FileReadCallback file_read_callback_; 138 static Dart_FileReadCallback file_read_callback_;
136 static Dart_FileWriteCallback file_write_callback_; 139 static Dart_FileWriteCallback file_write_callback_;
137 static Dart_FileCloseCallback file_close_callback_; 140 static Dart_FileCloseCallback file_close_callback_;
138 static Dart_EntropySource entropy_source_callback_; 141 static Dart_EntropySource entropy_source_callback_;
139 }; 142 };
140 143
141 } // namespace dart 144 } // namespace dart
142 145
143 #endif // RUNTIME_VM_DART_H_ 146 #endif // RUNTIME_VM_DART_H_
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_nocore.cc ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698