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

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

Issue 2651633002: VM: [Kernel] Fix bootstraping when Kernel isolate is used. (Closed)
Patch Set: Created 3 years, 11 months 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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_KERNEL_ISOLATE_H_ 5 #ifndef RUNTIME_VM_KERNEL_ISOLATE_H_
6 #define RUNTIME_VM_KERNEL_ISOLATE_H_ 6 #define RUNTIME_VM_KERNEL_ISOLATE_H_
7 7
8 #if !defined(DART_PRECOMPILED_RUNTIME) 8 #if !defined(DART_PRECOMPILED_RUNTIME)
9 9
10 #include "include/dart_api.h" 10 #include "include/dart_api.h"
11 11
12 #include "vm/allocation.h" 12 #include "vm/allocation.h"
13 #include "vm/dart.h" 13 #include "vm/dart.h"
14 #include "vm/os_thread.h" 14 #include "vm/os_thread.h"
15 15
16 namespace dart { 16 namespace dart {
17 17
18 class KernelIsolate : public AllStatic { 18 class KernelIsolate : public AllStatic {
19 public: 19 public:
20 static const char* kName; 20 static const char* kName;
21 21
22 static void Run(); 22 static void Run();
23 23
24 static bool Exists(); 24 static bool Exists();
25 static bool IsRunning(); 25 static bool IsRunning();
26 static bool IsKernelIsolate(const Isolate* isolate); 26 static bool IsKernelIsolate(const Isolate* isolate);
27 static Dart_Port WaitForKernelPort(); 27 static Dart_Port WaitForKernelPort();
28 static Dart_Port KernelPort() { return kernel_port_; } 28 static Dart_Port KernelPort() { return kernel_port_; }
29 29
30 static bool LoadScript(const String& url, const String& source); 30 static bool LoadScript(const String& url, const String& source);
hausner 2017/01/24 00:50:55 LoadScript seems to have no implementation (even b
Vyacheslav Egorov (Google) 2017/01/30 19:34:14 Done.
31 31
32 static Dart_KernelCompilationResult CompileToKernel(const char* script_uri);
33
32 protected: 34 protected:
33 static Monitor* monitor_; 35 static Monitor* monitor_;
34 static Dart_IsolateCreateCallback create_callback_; 36 static Dart_IsolateCreateCallback create_callback_;
35 37
36 static void InitCallback(Isolate* I); 38 static void InitCallback(Isolate* I);
37 static void SetKernelIsolate(Isolate* isolate); 39 static void SetKernelIsolate(Isolate* isolate);
38 static void SetLoadPort(Dart_Port port); 40 static void SetLoadPort(Dart_Port port);
39 static void FinishedInitializing(); 41 static void FinishedInitializing();
40 42
41 static Dart_Port kernel_port_; 43 static Dart_Port kernel_port_;
42 static Isolate* isolate_; 44 static Isolate* isolate_;
43 static bool initializing_; 45 static bool initializing_;
44 46
45 static Dart_IsolateCreateCallback create_callback() { 47 static Dart_IsolateCreateCallback create_callback() {
46 return create_callback_; 48 return create_callback_;
47 } 49 }
48 50
49 friend class Dart; 51 friend class Dart;
50 friend class RunKernelTask; 52 friend class RunKernelTask;
51 }; 53 };
52 54
53 } // namespace dart 55 } // namespace dart
54 56
55 #endif // DART_PRECOMPILED_RUNTIME 57 #endif // DART_PRECOMPILED_RUNTIME
56 58
57 #endif // RUNTIME_VM_KERNEL_ISOLATE_H_ 59 #endif // RUNTIME_VM_KERNEL_ISOLATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698