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

Unified Diff: runtime/vm/debugger_api_impl.cc

Issue 10414084: Replace linked list of loaded libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger_api_impl.cc
===================================================================
--- runtime/vm/debugger_api_impl.cc (revision 7922)
+++ runtime/vm/debugger_api_impl.cc (working copy)
@@ -498,26 +498,21 @@
ASSERT(isolate != NULL);
DARTSCOPE(isolate);
- // Find out how many libraries are loaded in this isolate.
- int num_libs = 0;
- Library &lib = Library::Handle();
- lib = isolate->object_store()->registered_libraries();
- while (!lib.IsNull()) {
- num_libs++;
- lib = lib.next_registered();
- }
+ const GrowableObjectArray& libs =
+ GrowableObjectArray::Handle(isolate->object_store()->libraries());
+ int num_libs = libs.Length();
// Create new list and populate with the url of loaded libraries.
- const Array& library_list = Array::Handle(Array::New(num_libs));
- lib = isolate->object_store()->registered_libraries();
+ Library &lib = Library::Handle();
String& lib_url = String::Handle();
+ const Array& library_url_list = Array::Handle(Array::New(num_libs));
for (int i = 0; i < num_libs; i++) {
+ lib ^= libs.At(i);
ASSERT(!lib.IsNull());
lib_url = lib.url();
- library_list.SetAt(i, lib_url);
- lib = lib.next_registered();
+ library_url_list.SetAt(i, lib_url);
}
- return Api::NewHandle(isolate, library_list.raw());
+ return Api::NewHandle(isolate, library_url_list.raw());
}
} // namespace dart
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698