OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/service.h" | 5 #include "vm/service.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
9 | 9 |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 } | 1292 } |
1293 | 1293 |
1294 | 1294 |
1295 static bool HandleScriptsEnumerate(Isolate* isolate, JSONStream* js) { | 1295 static bool HandleScriptsEnumerate(Isolate* isolate, JSONStream* js) { |
1296 JSONObject jsobj(js); | 1296 JSONObject jsobj(js); |
1297 jsobj.AddProperty("type", "ScriptList"); | 1297 jsobj.AddProperty("type", "ScriptList"); |
1298 jsobj.AddProperty("id", "scripts"); | 1298 jsobj.AddProperty("id", "scripts"); |
1299 JSONArray members(&jsobj, "members"); | 1299 JSONArray members(&jsobj, "members"); |
1300 const GrowableObjectArray& libs = | 1300 const GrowableObjectArray& libs = |
1301 GrowableObjectArray::Handle(isolate->object_store()->libraries()); | 1301 GrowableObjectArray::Handle(isolate->object_store()->libraries()); |
1302 int num_libs = libs.Length(); | 1302 intptr_t num_libs = libs.Length(); |
1303 Library &lib = Library::Handle(); | 1303 Library &lib = Library::Handle(); |
1304 Script& script = Script::Handle(); | 1304 Script& script = Script::Handle(); |
1305 for (intptr_t i = 0; i < num_libs; i++) { | 1305 for (intptr_t i = 0; i < num_libs; i++) { |
1306 lib ^= libs.At(i); | 1306 lib ^= libs.At(i); |
1307 ASSERT(!lib.IsNull()); | 1307 ASSERT(!lib.IsNull()); |
1308 ASSERT(Smi::IsValid(lib.index())); | 1308 ASSERT(Smi::IsValid(lib.index())); |
1309 const Array& loaded_scripts = Array::Handle(lib.LoadedScripts()); | 1309 const Array& loaded_scripts = Array::Handle(lib.LoadedScripts()); |
1310 ASSERT(!loaded_scripts.IsNull()); | 1310 ASSERT(!loaded_scripts.IsNull()); |
1311 intptr_t num_scripts = loaded_scripts.Length(); | 1311 intptr_t num_scripts = loaded_scripts.Length(); |
1312 for (intptr_t i = 0; i < num_scripts; i++) { | 1312 for (intptr_t i = 0; i < num_scripts; i++) { |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 while (current != NULL) { | 1962 while (current != NULL) { |
1963 if (strcmp(name, current->name()) == 0) { | 1963 if (strcmp(name, current->name()) == 0) { |
1964 return current; | 1964 return current; |
1965 } | 1965 } |
1966 current = current->next(); | 1966 current = current->next(); |
1967 } | 1967 } |
1968 return NULL; | 1968 return NULL; |
1969 } | 1969 } |
1970 | 1970 |
1971 } // namespace dart | 1971 } // namespace dart |
OLD | NEW |