Chromium Code Reviews| 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/isolate.h" | 5 #include "vm/isolate.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/json.h" | 9 #include "platform/json.h" |
| 10 #include "lib/mirrors.h" | 10 #include "lib/mirrors.h" |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 969 ASSERT(!error.IsNull()); | 969 ASSERT(!error.IsNull()); |
| 970 jsobj.AddProperty("error", error, false); | 970 jsobj.AddProperty("error", error, false); |
| 971 } | 971 } |
| 972 | 972 |
| 973 { | 973 { |
| 974 JSONObject typeargsRef(&jsobj, "canonicalTypeArguments"); | 974 JSONObject typeargsRef(&jsobj, "canonicalTypeArguments"); |
| 975 typeargsRef.AddProperty("type", "@TypeArgumentsList"); | 975 typeargsRef.AddProperty("type", "@TypeArgumentsList"); |
| 976 typeargsRef.AddProperty("id", "typearguments"); | 976 typeargsRef.AddProperty("id", "typearguments"); |
| 977 typeargsRef.AddProperty("name", "canonical type arguments"); | 977 typeargsRef.AddProperty("name", "canonical type arguments"); |
| 978 } | 978 } |
| 979 bool is_io_enabled = false; | |
| 979 { | 980 { |
| 980 const GrowableObjectArray& libs = | 981 const GrowableObjectArray& libs = |
| 981 GrowableObjectArray::Handle(object_store()->libraries()); | 982 GrowableObjectArray::Handle(object_store()->libraries()); |
| 982 intptr_t num_libs = libs.Length(); | 983 intptr_t num_libs = libs.Length(); |
| 983 Library &lib = Library::Handle(); | 984 Library& lib = Library::Handle(); |
| 985 String& name = String::Handle(); | |
| 984 | 986 |
| 985 JSONArray lib_array(&jsobj, "libraries"); | 987 JSONArray lib_array(&jsobj, "libraries"); |
| 986 for (intptr_t i = 0; i < num_libs; i++) { | 988 for (intptr_t i = 0; i < num_libs; i++) { |
| 987 lib ^= libs.At(i); | 989 lib ^= libs.At(i); |
| 990 name = lib.name(); | |
|
Cutch
2014/05/23 05:51:37
We should test the case when an imported library i
Anders Johnsen
2014/05/23 05:59:13
I checked, and they are. Do you want a actual test
| |
| 991 if (name.Equals(Symbols::DartIOLibName())) { | |
| 992 is_io_enabled = true; | |
| 993 } | |
| 988 ASSERT(!lib.IsNull()); | 994 ASSERT(!lib.IsNull()); |
| 989 lib_array.AddValue(lib); | 995 lib_array.AddValue(lib); |
| 990 } | 996 } |
| 991 } | 997 } |
| 998 { | |
| 999 JSONArray features_array(&jsobj, "features"); | |
| 1000 if (is_io_enabled) { | |
| 1001 features_array.AddValue("io"); | |
| 1002 } | |
| 1003 } | |
| 992 } | 1004 } |
| 993 | 1005 |
| 994 | 1006 |
| 995 void Isolate::ProfileInterrupt() { | 1007 void Isolate::ProfileInterrupt() { |
| 996 InterruptableThreadState* state = thread_state(); | 1008 InterruptableThreadState* state = thread_state(); |
| 997 if (state == NULL) { | 1009 if (state == NULL) { |
| 998 // Isolate is not scheduled on a thread. | 1010 // Isolate is not scheduled on a thread. |
| 999 ProfileIdle(); | 1011 ProfileIdle(); |
| 1000 return; | 1012 return; |
| 1001 } | 1013 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1183 return func.raw(); | 1195 return func.raw(); |
| 1184 } | 1196 } |
| 1185 | 1197 |
| 1186 | 1198 |
| 1187 void IsolateSpawnState::Cleanup() { | 1199 void IsolateSpawnState::Cleanup() { |
| 1188 SwitchIsolateScope switch_scope(isolate()); | 1200 SwitchIsolateScope switch_scope(isolate()); |
| 1189 Dart::ShutdownIsolate(); | 1201 Dart::ShutdownIsolate(); |
| 1190 } | 1202 } |
| 1191 | 1203 |
| 1192 } // namespace dart | 1204 } // namespace dart |
| OLD | NEW |