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

Unified Diff: runtime/vm/isolate.cc

Issue 1386503002: Initial design for background compilation (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address Comments 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/isolate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 669af56660e4a18d15d85ef8cc23709f8b20a95c..3982b6b00a228e9b2f34c3074477e35a7f9bfa51 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -8,7 +8,9 @@
#include "include/dart_native_api.h"
#include "platform/assert.h"
#include "platform/json.h"
+#include "vm/class_finalizer.h"
#include "vm/code_observers.h"
+#include "vm/compiler.h"
#include "vm/compiler_stats.h"
#include "vm/coverage.h"
#include "vm/dart_api_message.h"
@@ -24,7 +26,6 @@
#include "vm/object_store.h"
#include "vm/object.h"
#include "vm/os_thread.h"
-#include "vm/parser.h"
#include "vm/port.h"
#include "vm/profiler.h"
#include "vm/reusable_handles.h"
@@ -745,6 +746,7 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
gc_epilogue_callback_(NULL),
defer_finalization_count_(0),
deopt_context_(NULL),
+ background_compiler_(NULL),
compiler_stats_(NULL),
is_service_isolate_(false),
stacktrace_(NULL),
@@ -757,6 +759,7 @@ Isolate::Isolate(const Dart_IsolateFlags& api_flags)
tag_table_(GrowableObjectArray::null()),
collected_closures_(GrowableObjectArray::null()),
deoptimized_code_array_(GrowableObjectArray::null()),
+ background_compilation_queue_(GrowableObjectArray::null()),
pending_service_extension_calls_(GrowableObjectArray::null()),
registered_service_extension_handlers_(GrowableObjectArray::null()),
metrics_list_head_(NULL),
@@ -1685,6 +1688,8 @@ void Isolate::Shutdown() {
}
#endif
+ BackgroundCompiler::Stop(background_compiler_);
+
// TODO(5411455): For now just make sure there are no current isolates
// as we are shutting down the isolate.
Thread::ExitIsolate();
@@ -1760,6 +1765,9 @@ void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
// Visit array of closures pending precompilation.
visitor->VisitPointer(reinterpret_cast<RawObject**>(&collected_closures_));
+ visitor->VisitPointer(reinterpret_cast<RawObject**>(
+ &background_compilation_queue_));
+
// Visit the deoptimized code array which is stored in the isolate.
visitor->VisitPointer(
reinterpret_cast<RawObject**>(&deoptimized_code_array_));
@@ -1969,6 +1977,12 @@ void Isolate::set_deoptimized_code_array(const GrowableObjectArray& value) {
}
+void Isolate::set_background_compilation_queue(
+ const GrowableObjectArray& value) {
+ background_compilation_queue_ = value.raw();
+}
+
+
void Isolate::TrackDeoptimizedCode(const Code& code) {
ASSERT(!code.IsNull());
const GrowableObjectArray& deoptimized_code =
« no previous file with comments | « runtime/vm/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698