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

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

Issue 1386503002: Initial design for background compilation (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: More cleanups Created 5 years, 2 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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_COMPILER_H_ 5 #ifndef VM_COMPILER_H_
6 #define VM_COMPILER_H_ 6 #define VM_COMPILER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
11 #include "vm/thread_pool.h"
11 12
12 namespace dart { 13 namespace dart {
13 14
14 // Forward declarations. 15 // Forward declarations.
15 class Class; 16 class Class;
16 class Function; 17 class Function;
17 class Library; 18 class Library;
18 class ParsedFunction; 19 class ParsedFunction;
19 class RawInstance; 20 class RawInstance;
20 class Script; 21 class Script;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 static bool allow_recompilation() { return allow_recompilation_; } 93 static bool allow_recompilation() { return allow_recompilation_; }
93 static void set_allow_recompilation(bool value) { 94 static void set_allow_recompilation(bool value) {
94 allow_recompilation_ = value; 95 allow_recompilation_ = value;
95 } 96 }
96 97
97 private: 98 private:
98 static bool always_optimize_; 99 static bool always_optimize_;
99 static bool allow_recompilation_; 100 static bool allow_recompilation_;
100 }; 101 };
101 102
103
104 class CompileOptimizedTask : public ThreadPool::Task {
koda 2015/10/02 16:53:46 The name "task" is slightly confusing to me, since
srdjan 2015/10/02 18:19:20 Renamed to BackgroundCompiler. Why should "Isolate
koda 2015/10/02 18:58:05 Not that field; I meant the added fields/accessors
105 public:
106 explicit CompileOptimizedTask(Isolate* isolate);
107
108 virtual void Run();
109
110 void CompileOptimized(const Function& function);
111
112 void Add(const Function& f);
113 RawFunction* RemoveOrNull();
114
115 static void EnsureInit(Isolate* isolate);
116
117 static void Stop(CompileOptimizedTask* task);
118
119 private:
120 Isolate* isolate_;
121 bool running_;
122 bool* done_;
123 Monitor* monitor_;
124 Monitor* done_monitor_;
125
126 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileOptimizedTask);
127 };
128
102 } // namespace dart 129 } // namespace dart
103 130
104 #endif // VM_COMPILER_H_ 131 #endif // VM_COMPILER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698