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

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

Issue 1280013004: Restore frame validation (fixes to CL faaf60801f72). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Clean up test. 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/thread_test.cc » ('j') | 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 const Entry& entry = entries_[i]; 108 const Entry& entry = entries_[i];
109 if (entry.scheduled) { 109 if (entry.scheduled) {
110 FATAL3("Isolate %p still scheduled on %p (whose isolate_ is %p)\n", 110 FATAL3("Isolate %p still scheduled on %p (whose isolate_ is %p)\n",
111 isolate, 111 isolate,
112 entry.thread, 112 entry.thread,
113 entry.thread->isolate()); 113 entry.thread->isolate());
114 } 114 }
115 } 115 }
116 } 116 }
117 117
118 void VisitObjectPointers(ObjectPointerVisitor* visitor) { 118 void VisitObjectPointers(ObjectPointerVisitor* visitor,
119 bool validate_frames) {
119 MonitorLocker ml(monitor_); 120 MonitorLocker ml(monitor_);
120 for (int i = 0; i < entries_.length(); ++i) { 121 for (int i = 0; i < entries_.length(); ++i) {
121 const Entry& entry = entries_[i]; 122 const Entry& entry = entries_[i];
122 const Thread::State& state = 123 const Thread::State& state =
123 entry.scheduled ? entry.thread->state_ : entry.state; 124 entry.scheduled ? entry.thread->state_ : entry.state;
124 if (state.zone != NULL) { 125 if (state.zone != NULL) {
125 state.zone->VisitObjectPointers(visitor); 126 state.zone->VisitObjectPointers(visitor);
126 } 127 }
127 // Iterate over all the stack frames and visit objects on the stack. 128 // Iterate over all the stack frames and visit objects on the stack.
128 uword efi = state.top_exit_frame_info; 129 StackFrameIterator frames_iterator(state.top_exit_frame_info,
129 if (efi == 0) continue; 130 validate_frames);
130 StackFrameIterator frames_iterator(efi, false);
131 StackFrame* frame = frames_iterator.NextFrame(); 131 StackFrame* frame = frames_iterator.NextFrame();
132 while (frame != NULL) { 132 while (frame != NULL) {
133 frame->VisitObjectPointers(visitor); 133 frame->VisitObjectPointers(visitor);
134 frame = frames_iterator.NextFrame(); 134 frame = frames_iterator.NextFrame();
135 } 135 }
136 } 136 }
137 } 137 }
138 138
139 private: 139 private:
140 struct Entry { 140 struct Entry {
(...skipping 29 matching lines...) Expand all
170 intptr_t remaining_; // Number of threads yet to reach their safepoint. 170 intptr_t remaining_; // Number of threads yet to reach their safepoint.
171 int64_t round_; // Counter, to prevent missing updates to remaining_ 171 int64_t round_; // Counter, to prevent missing updates to remaining_
172 // (see comments in CheckSafepointLocked). 172 // (see comments in CheckSafepointLocked).
173 173
174 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry); 174 DISALLOW_COPY_AND_ASSIGN(ThreadRegistry);
175 }; 175 };
176 176
177 } // namespace dart 177 } // namespace dart
178 178
179 #endif // VM_THREAD_REGISTRY_H_ 179 #endif // VM_THREAD_REGISTRY_H_
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698