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

Side by Side Diff: runtime/vm/object_graph.cc

Issue 1410643008: Get rid of deprecated methods accessing mutator_thread_ instead of current thread (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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/object_graph.h ('k') | runtime/vm/object_graph_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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 #include "vm/object_graph.h" 5 #include "vm/object_graph.h"
6 6
7 #include "vm/dart.h" 7 #include "vm/dart.h"
8 #include "vm/growable_array.h" 8 #include "vm/growable_array.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 static void UnmarkAll(Isolate* isolate) { 149 static void UnmarkAll(Isolate* isolate) {
150 Unmarker unmarker(isolate); 150 Unmarker unmarker(isolate);
151 isolate->heap()->IterateObjects(&unmarker); 151 isolate->heap()->IterateObjects(&unmarker);
152 } 152 }
153 153
154 private: 154 private:
155 DISALLOW_COPY_AND_ASSIGN(Unmarker); 155 DISALLOW_COPY_AND_ASSIGN(Unmarker);
156 }; 156 };
157 157
158 158
159 ObjectGraph::ObjectGraph(Isolate* isolate) 159 ObjectGraph::ObjectGraph(Thread* thread)
160 : StackResource(isolate) { 160 : StackResource(thread) {
161 // The VM isolate has all its objects pre-marked, so iterating over it 161 // The VM isolate has all its objects pre-marked, so iterating over it
162 // would be a no-op. 162 // would be a no-op.
163 ASSERT(isolate != Dart::vm_isolate()); 163 ASSERT(thread->isolate() != Dart::vm_isolate());
164 isolate->heap()->WriteProtectCode(false); 164 thread->isolate()->heap()->WriteProtectCode(false);
165 } 165 }
166 166
167 167
168 ObjectGraph::~ObjectGraph() { 168 ObjectGraph::~ObjectGraph() {
169 isolate()->heap()->WriteProtectCode(true); 169 isolate()->heap()->WriteProtectCode(true);
170 } 170 }
171 171
172 172
173 void ObjectGraph::IterateObjects(ObjectGraph::Visitor* visitor) { 173 void ObjectGraph::IterateObjects(ObjectGraph::Visitor* visitor) {
174 NoSafepointScope no_safepoint_scope_; 174 NoSafepointScope no_safepoint_scope_;
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 { 474 {
475 WritePointerVisitor ptr_writer(isolate(), stream); 475 WritePointerVisitor ptr_writer(isolate(), stream);
476 isolate()->IterateObjectPointers(&ptr_writer, false, false); 476 isolate()->IterateObjectPointers(&ptr_writer, false, false);
477 } 477 }
478 stream->WriteUnsigned(0); 478 stream->WriteUnsigned(0);
479 IterateObjects(&visitor); 479 IterateObjects(&visitor);
480 return visitor.count() + 1; // + root 480 return visitor.count() + 1; // + root
481 } 481 }
482 482
483 } // namespace dart 483 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_graph.h ('k') | runtime/vm/object_graph_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698