| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_debugger_api.h" | 6 #include "include/dart_debugger_api.h" |
| 7 #include "platform/json.h" | 7 #include "platform/json.h" |
| 8 #include "vm/bootstrap_natives.h" | 8 #include "vm/bootstrap_natives.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/exceptions.h" | 10 #include "vm/exceptions.h" |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 } | 826 } |
| 827 | 827 |
| 828 return lib_mirror; | 828 return lib_mirror; |
| 829 } | 829 } |
| 830 | 830 |
| 831 | 831 |
| 832 static Dart_Handle CreateLibrariesMap() { | 832 static Dart_Handle CreateLibrariesMap() { |
| 833 // TODO(turnidge): This should be an immutable map. | 833 // TODO(turnidge): This should be an immutable map. |
| 834 Dart_Handle map = MapNew(); | 834 Dart_Handle map = MapNew(); |
| 835 | 835 |
| 836 Dart_Handle lib_urls = Dart_GetLibraryURLs(); | 836 Dart_Handle lib_ids = Dart_GetLibraryIds(); |
| 837 if (Dart_IsError(lib_urls)) { | 837 if (Dart_IsError(lib_ids)) { |
| 838 return lib_urls; | 838 return lib_ids; |
| 839 } | 839 } |
| 840 intptr_t len; | 840 intptr_t len; |
| 841 Dart_Handle result = Dart_ListLength(lib_urls, &len); | 841 Dart_Handle result = Dart_ListLength(lib_ids, &len); |
| 842 if (Dart_IsError(result)) { | 842 if (Dart_IsError(result)) { |
| 843 return result; | 843 return result; |
| 844 } | 844 } |
| 845 for (intptr_t i = 0; i < len; i++) { | 845 for (intptr_t i = 0; i < len; i++) { |
| 846 Dart_Handle lib_url = Dart_ListGetAt(lib_urls, i); | 846 Dart_Handle lib_id = Dart_ListGetAt(lib_ids, i); |
| 847 int64_t id64; |
| 848 Dart_IntegerToInt64(lib_id, &id64); |
| 849 Dart_Handle lib_url = Dart_GetLibraryURL(id64); |
| 850 if (Dart_IsError(lib_url)) { |
| 851 return lib_url; |
| 852 } |
| 847 Dart_Handle lib = Dart_LookupLibrary(lib_url); | 853 Dart_Handle lib = Dart_LookupLibrary(lib_url); |
| 848 if (Dart_IsError(lib)) { | 854 if (Dart_IsError(lib)) { |
| 849 return lib; | 855 return lib; |
| 850 } | 856 } |
| 851 Dart_Handle lib_key = Dart_LibraryName(lib); | 857 Dart_Handle lib_key = Dart_LibraryName(lib); |
| 852 Dart_Handle lib_mirror = CreateLibraryMirror(lib); | 858 Dart_Handle lib_mirror = CreateLibraryMirror(lib); |
| 853 if (Dart_IsError(lib_mirror)) { | 859 if (Dart_IsError(lib_mirror)) { |
| 854 return lib_mirror; | 860 return lib_mirror; |
| 855 } | 861 } |
| 856 // TODO(turnidge): Check for duplicate library names. | 862 // TODO(turnidge): Check for duplicate library names. |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 } | 1203 } |
| 1198 | 1204 |
| 1199 | 1205 |
| 1200 void HandleMirrorsMessage(Isolate* isolate, | 1206 void HandleMirrorsMessage(Isolate* isolate, |
| 1201 Dart_Port reply_port, | 1207 Dart_Port reply_port, |
| 1202 const Instance& message) { | 1208 const Instance& message) { |
| 1203 UNIMPLEMENTED(); | 1209 UNIMPLEMENTED(); |
| 1204 } | 1210 } |
| 1205 | 1211 |
| 1206 } // namespace dart | 1212 } // namespace dart |
| OLD | NEW |