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

Side by Side Diff: runtime/vm/thread_registry.h

Issue 1393013005: Fix GC problem with vm_handles in thread (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add comment 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/thread.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_THREAD_REGISTRY_H_ 5 #ifndef VM_THREAD_REGISTRY_H_
6 #define VM_THREAD_REGISTRY_H_ 6 #define VM_THREAD_REGISTRY_H_
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 void VisitObjectPointers(ObjectPointerVisitor* visitor, 122 void VisitObjectPointers(ObjectPointerVisitor* visitor,
123 bool validate_frames) { 123 bool validate_frames) {
124 MonitorLocker ml(monitor_); 124 MonitorLocker ml(monitor_);
125 for (int i = 0; i < entries_.length(); ++i) { 125 for (int i = 0; i < entries_.length(); ++i) {
126 const Entry& entry = entries_[i]; 126 const Entry& entry = entries_[i];
127 const Thread::State& state = 127 const Thread::State& state =
128 entry.scheduled ? entry.thread->state_ : entry.state; 128 entry.scheduled ? entry.thread->state_ : entry.state;
129 if (state.zone != NULL) { 129 if (state.zone != NULL) {
130 state.zone->VisitObjectPointers(visitor); 130 state.zone->VisitObjectPointers(visitor);
131 } 131 }
132 ASSERT(entry.thread != NULL); 132 if (entry.scheduled) {
133 entry.thread->VisitObjectPointers(visitor); 133 ASSERT(entry.thread != NULL);
134 entry.thread->VisitObjectPointers(visitor);
135 }
134 // Iterate over all the stack frames and visit objects on the stack. 136 // Iterate over all the stack frames and visit objects on the stack.
135 StackFrameIterator frames_iterator(state.top_exit_frame_info, 137 StackFrameIterator frames_iterator(state.top_exit_frame_info,
136 validate_frames); 138 validate_frames);
137 StackFrame* frame = frames_iterator.NextFrame(); 139 StackFrame* frame = frames_iterator.NextFrame();
138 while (frame != NULL) { 140 while (frame != NULL) {
139 frame->VisitObjectPointers(visitor); 141 frame->VisitObjectPointers(visitor);
140 frame = frames_iterator.NextFrame(); 142 frame = frames_iterator.NextFrame();
141 } 143 }
142 } 144 }
143 } 145 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 intptr_t remaining_; // Number of threads yet to reach their safepoint. 206 intptr_t remaining_; // Number of threads yet to reach their safepoint.
205 int64_t round_; // Counter, to prevent missing updates to remaining_ 207 int64_t round_; // Counter, to prevent missing updates to remaining_
206 // (see comments in CheckSafepointLocked). 208 // (see comments in CheckSafepointLocked).
207 209
208 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry); 210 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry);
209 }; 211 };
210 212
211 } // namespace dart 213 } // namespace dart
212 214
213 #endif // VM_THREAD_REGISTRY_H_ 215 #endif // VM_THREAD_REGISTRY_H_
OLDNEW
« no previous file with comments | « runtime/vm/thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698