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

Unified Diff: runtime/vm/compiler.h

Issue 1409173002: More work for background compilation; move pending_functions_ from ObjectStore to Thread. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Better code. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.h
diff --git a/runtime/vm/compiler.h b/runtime/vm/compiler.h
index 9c3e73fbf67595b66e6b7288fff4689a5c745bdf..d91f4c659c8a651d849a5c1e6b4b008ab2f637bd 100644
--- a/runtime/vm/compiler.h
+++ b/runtime/vm/compiler.h
@@ -112,19 +112,26 @@ class BackgroundCompiler : public ThreadPool::Task {
void CompileOptimized(const Function& function);
+ // Access to queue length is guarded with queue_monitor_;
+ intptr_t queue_length() const { return queue_length_; }
+ void set_queue_length(intptr_t value) { queue_length_ = value; }
+
private:
explicit BackgroundCompiler(Isolate* isolate);
virtual void Run();
- void Add(const Function& f) const;
- RawFunction* RemoveOrNull() const;
+ void Add(const Function& f);
+ RawFunction* RemoveOrNull();
+ RawFunction* LastOrNull() const;
Isolate* isolate_;
- bool running_;
- bool* done_;
- Monitor* monitor_;
- Monitor* done_monitor_;
+ bool running_; // While true, will try to read queue and compile.
+ bool* done_; // True if the thread is done.
+ Monitor* queue_monitor_; // Controls access to the queue.
+ Monitor* done_monitor_; // Notify/wait that the thread is done.
+
+ intptr_t queue_length_; // Lightweight access to length of compiler queue.
DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundCompiler);
};
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698