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

Unified Diff: runtime/vm/thread.cc

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 | « runtime/vm/thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 09ae4c0d1ea29dc5dfcc71237649dcacf7dcb9cb..a2af102a7ebc4736a645e2fd800e2c5b4ef5aa8a 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -185,12 +185,13 @@ Thread::Thread(bool init_vm_constants)
timeline_block_(NULL),
store_buffer_block_(NULL),
log_(new class Log()),
- deopt_id_(0),
- vm_tag_(0),
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
reusable_handles_(),
cha_(NULL),
+ deopt_id_(0),
+ vm_tag_(0),
+ pending_functions_(GrowableObjectArray::null()),
no_callback_scope_depth_(0),
thread_list_next_(NULL) {
ClearState();
@@ -250,6 +251,20 @@ LEAF_RUNTIME_ENTRY_LIST(INIT_VALUE)
}
+void Thread::ClearState() {
+ memset(&state_, 0, sizeof(state_));
+ pending_functions_ = GrowableObjectArray::null();
+}
+
+
+RawGrowableObjectArray* Thread::pending_functions() {
+ if (pending_functions_ == GrowableObjectArray::null()) {
+ pending_functions_ = GrowableObjectArray::New(Heap::kOld);
+ }
+ return pending_functions_;
+}
+
+
void Thread::Schedule(Isolate* isolate, bool bypass_safepoint) {
State st;
if (isolate->thread_registry()->RestoreStateTo(this, &st, bypass_safepoint)) {
@@ -429,6 +444,11 @@ void Thread::VisitObjectPointers(ObjectPointerVisitor* visitor) {
// Visit objects in thread specific handles area.
reusable_handles_.VisitObjectPointers(visitor);
+
+ if (pending_functions_ != GrowableObjectArray::null()) {
+ visitor->VisitPointer(
+ reinterpret_cast<RawObject**>(&pending_functions_));
+ }
}
« no previous file with comments | « runtime/vm/thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698