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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 } | 892 } |
893 } | 893 } |
894 { | 894 { |
895 JSONObject jsheap(&jsobj, "heap"); | 895 JSONObject jsheap(&jsobj, "heap"); |
896 jsheap.AddProperty("usedNew", heap()->UsedInWords(Heap::kNew)); | 896 jsheap.AddProperty("usedNew", heap()->UsedInWords(Heap::kNew)); |
897 jsheap.AddProperty("capacityNew", heap()->CapacityInWords(Heap::kNew)); | 897 jsheap.AddProperty("capacityNew", heap()->CapacityInWords(Heap::kNew)); |
898 jsheap.AddProperty("usedOld", heap()->UsedInWords(Heap::kOld)); | 898 jsheap.AddProperty("usedOld", heap()->UsedInWords(Heap::kOld)); |
899 jsheap.AddProperty("capacityOld", heap()->CapacityInWords(Heap::kOld)); | 899 jsheap.AddProperty("capacityOld", heap()->CapacityInWords(Heap::kOld)); |
900 } | 900 } |
901 | 901 |
| 902 // TODO(turnidge): Don't compute a full stack trace every time we |
| 903 // request an isolate's info. |
902 DebuggerStackTrace* stack = debugger()->StackTrace(); | 904 DebuggerStackTrace* stack = debugger()->StackTrace(); |
903 if (stack->Length() > 0) { | 905 if (stack->Length() > 0) { |
904 JSONObject jsframe(&jsobj, "topFrame"); | 906 JSONObject jsframe(&jsobj, "topFrame"); |
905 | 907 |
906 ActivationFrame* frame = stack->FrameAt(0); | 908 ActivationFrame* frame = stack->FrameAt(0); |
907 frame->PrintToJSONObject(&jsobj); | 909 frame->PrintToJSONObject(&jsobj); |
908 // TODO(turnidge): Implement depth differently -- differentiate | 910 // TODO(turnidge): Implement depth differently -- differentiate |
909 // inlined frames. | 911 // inlined frames. |
910 jsobj.AddProperty("depth", (intptr_t)0); | 912 jsobj.AddProperty("depth", (intptr_t)0); |
911 } | 913 } |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 return func.raw(); | 1121 return func.raw(); |
1120 } | 1122 } |
1121 | 1123 |
1122 | 1124 |
1123 void IsolateSpawnState::Cleanup() { | 1125 void IsolateSpawnState::Cleanup() { |
1124 SwitchIsolateScope switch_scope(isolate()); | 1126 SwitchIsolateScope switch_scope(isolate()); |
1125 Dart::ShutdownIsolate(); | 1127 Dart::ShutdownIsolate(); |
1126 } | 1128 } |
1127 | 1129 |
1128 } // namespace dart | 1130 } // namespace dart |
OLD | NEW |