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

Unified Diff: runtime/vm/compiler.cc

Issue 1412463007: Move compilation queues into BackgroundCompiler class (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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 | « runtime/vm/compiler.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index ee9e41b631e217cd3a74f4f443e3566abe8227cc..f3c7ab75d27f99f59231d5fc97cbc220955f9149 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -1614,7 +1614,9 @@ void BackgroundCompilationResult::PopFromQueue(CompilationWorkQueue* queue) {
BackgroundCompiler::BackgroundCompiler(Isolate* isolate)
: isolate_(isolate), running_(true), done_(new bool()),
queue_monitor_(new Monitor()), done_monitor_(new Monitor()),
- function_queue_length_(0) {
+ function_queue_length_(0),
+ compilation_function_queue_(GrowableObjectArray::null()),
+ compilation_result_queue_(GrowableObjectArray::null()) {
*done_ = false;
}
@@ -1702,13 +1704,12 @@ void BackgroundCompiler::InstallGeneratedCode() {
GrowableObjectArray* BackgroundCompiler::FunctionsQueue() const {
- return
- &GrowableObjectArray::ZoneHandle(isolate_->compilation_function_queue());
+ return &GrowableObjectArray::ZoneHandle(compilation_function_queue_);
}
GrowableObjectArray* BackgroundCompiler::ResultQueue() const {
- return &GrowableObjectArray::ZoneHandle(isolate_->compilation_result_queue());
+ return &GrowableObjectArray::ZoneHandle(compilation_result_queue_);
}
@@ -1745,6 +1746,27 @@ void BackgroundCompiler::AddResult(const BackgroundCompilationResult& value) {
}
+void BackgroundCompiler::set_compilation_function_queue(
+ const GrowableObjectArray& value) {
+ compilation_function_queue_ = value.raw();
+}
+
+
+void BackgroundCompiler::set_compilation_result_queue(
+ const GrowableObjectArray& value) {
+ compilation_result_queue_ = value.raw();
+}
+
+
+void BackgroundCompiler::VisitPointers(ObjectPointerVisitor* visitor) {
+ visitor->VisitPointer(reinterpret_cast<RawObject**>(
+ &compilation_function_queue_));
+
+ visitor->VisitPointer(reinterpret_cast<RawObject**>(
+ &compilation_result_queue_));
+}
+
+
void BackgroundCompiler::Stop(BackgroundCompiler* task) {
ASSERT(Isolate::Current()->background_compiler() == task);
if (task == NULL) {
@@ -1783,9 +1805,9 @@ void BackgroundCompiler::EnsureInit(Thread* thread) {
if (isolate->background_compiler() == NULL) {
BackgroundCompiler* task = new BackgroundCompiler(isolate);
isolate->set_background_compiler(task);
- isolate->set_compilation_function_queue(GrowableObjectArray::Handle(
+ task->set_compilation_function_queue(GrowableObjectArray::Handle(
thread->zone(), GrowableObjectArray::New()));
- isolate->set_compilation_result_queue(GrowableObjectArray::Handle(
+ task->set_compilation_result_queue(GrowableObjectArray::Handle(
thread->zone(), GrowableObjectArray::New()));
start_task = true;
}
« no previous file with comments | « runtime/vm/compiler.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698