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

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

Issue 8497032: Fix crash when running with --report_invocation_count. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/assert.h" 9 #include "vm/assert.h"
10 #include "vm/bigint_store.h" 10 #include "vm/bigint_store.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 HandleScope handle_scope; 166 HandleScope handle_scope;
167 Library& library = Library::Handle(); 167 Library& library = Library::Handle();
168 library = object_store()->registered_libraries(); 168 library = object_store()->registered_libraries();
169 GrowableArray<const Function*> invoked_functions; 169 GrowableArray<const Function*> invoked_functions;
170 while (!library.IsNull()) { 170 while (!library.IsNull()) {
171 Class& cls = Class::Handle(); 171 Class& cls = Class::Handle();
172 ClassDictionaryIterator iter(library); 172 ClassDictionaryIterator iter(library);
173 while (iter.HasNext()) { 173 while (iter.HasNext()) {
174 cls = iter.GetNextClass(); 174 cls = iter.GetNextClass();
175 const Array& functions = Array::Handle(cls.functions()); 175 const Array& functions = Array::Handle(cls.functions());
176 for (int j = 0; j < functions.Length(); j++) { 176 // Class 'Dynamic' is allocated/initialized in a special way, leaving
177 // the functions field NULL instead of empty.
178 int func_len = functions.IsNull() ? 0 : functions.Length();
regis 2011/11/09 01:51:08 const
srdjan 2011/11/09 16:25:06 Done.
179 for (int j = 0; j < func_len; j++) {
177 Function& function = Function::Handle(); 180 Function& function = Function::Handle();
178 function ^= functions.At(j); 181 function ^= functions.At(j);
179 if (function.invocation_counter() > 0) { 182 if (function.invocation_counter() > 0) {
180 invoked_functions.Add(&function); 183 invoked_functions.Add(&function);
181 } 184 }
182 } 185 }
183 } 186 }
184 library = library.next_registered(); 187 library = library.next_registered();
185 } 188 }
186 invoked_functions.Sort(MostCalledFunctionFirst); 189 invoked_functions.Sort(MostCalledFunctionFirst);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 // Visit all objects in the code index table. 283 // Visit all objects in the code index table.
281 if (code_index_table() != NULL) { 284 if (code_index_table() != NULL) {
282 code_index_table()->VisitObjectPointers(visitor); 285 code_index_table()->VisitObjectPointers(visitor);
283 } 286 }
284 287
285 // Visit the top context which is stored in the isolate. 288 // Visit the top context which is stored in the isolate.
286 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_)); 289 visitor->VisitPointer(reinterpret_cast<RawObject**>(&top_context_));
287 } 290 }
288 291
289 } // namespace dart 292 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698