Chromium Code Reviews| Index: runtime/vm/compiler.h |
| diff --git a/runtime/vm/compiler.h b/runtime/vm/compiler.h |
| index 9dc11b810541b2fa2ad60138e3752967a475021e..8eed617e3e37a574b8cf3655cc9334fb3266e249 100644 |
| --- a/runtime/vm/compiler.h |
| +++ b/runtime/vm/compiler.h |
| @@ -8,6 +8,7 @@ |
| #include "vm/allocation.h" |
| #include "vm/growable_array.h" |
| #include "vm/runtime_entry.h" |
| +#include "vm/thread_pool.h" |
| namespace dart { |
| @@ -99,6 +100,35 @@ class Compiler : public AllStatic { |
| static bool allow_recompilation_; |
| }; |
| + |
| +class CompileOptimizedTask : public ThreadPool::Task { |
| + public: |
| + explicit CompileOptimizedTask(Isolate* isolate); |
| + ~CompileOptimizedTask(); |
|
koda
2015/10/01 22:27:02
I believe this is the first task that defines a de
srdjan
2015/10/01 23:11:24
Removes destructor, all cleanup in Stop.
|
| + |
| + virtual void Run(); |
| + |
| + void CompileOptimized(const Function& function); |
| + |
| + void Add(const Function& f); |
| + RawFunction* RemoveOrNull(); |
| + |
| + Monitor* monitor() const { return monitor_; } |
| + |
| + static void Init(Isolate* isolate); |
|
koda
2015/10/01 22:27:02
What happens if multiple threads call 'Init'? Cons
srdjan
2015/10/01 23:11:24
Done. There is currently only one Dart code thread
|
| + |
| + static void Stop(CompileOptimizedTask* task); |
| + |
| + private: |
| + Isolate* isolate_; |
| + bool running_; |
| + bool* done_; |
| + Monitor* monitor_; |
| + Monitor* done_monitor_; |
| + |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(CompileOptimizedTask); |
| +}; |
| + |
| } // namespace dart |
| #endif // VM_COMPILER_H_ |