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

Unified Diff: runtime/vm/thread_registry.h

Issue 1282423003: Enable iterating over roots from helper threads by moving stack walking. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
Index: runtime/vm/thread_registry.h
diff --git a/runtime/vm/thread_registry.h b/runtime/vm/thread_registry.h
index f8f324dc752a2215edfa592086b3d5fbcd1944d3..b7d3e1a8a0877f2e1217c8c0925b77dc46be71be 100644
--- a/runtime/vm/thread_registry.h
+++ b/runtime/vm/thread_registry.h
@@ -9,6 +9,7 @@
#include "vm/growable_array.h"
#include "vm/isolate.h"
#include "vm/lockers.h"
+#include "vm/stack_frame.h"
#include "vm/thread.h"
namespace dart {
@@ -118,9 +119,19 @@ class ThreadRegistry {
MonitorLocker ml(monitor_);
for (int i = 0; i < entries_.length(); ++i) {
const Entry& entry = entries_[i];
- Zone* zone = entry.scheduled ? entry.thread->zone() : entry.state.zone;
- if (zone != NULL) {
- zone->VisitObjectPointers(visitor);
+ const Thread::State& state =
+ entry.scheduled ? entry.thread->state_ : entry.state;
+ if (state.zone != NULL) {
+ state.zone->VisitObjectPointers(visitor);
+ }
+ // Iterate over all the stack frames and visit objects on the stack.
+ uword efi = state.top_exit_frame_info;
+ if (efi == 0) continue;
+ StackFrameIterator frames_iterator(efi, false);
Ivan Posva 2015/08/11 17:41:31 Please do not use explicit constants and use the a
+ StackFrame* frame = frames_iterator.NextFrame();
+ while (frame != NULL) {
+ frame->VisitObjectPointers(visitor);
+ frame = frames_iterator.NextFrame();
}
}
}

Powered by Google App Engine
This is Rietveld 408576698