| 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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 } | 890 } |
| 891 } | 891 } |
| 892 { | 892 { |
| 893 JSONObject jsheap(&jsobj, "heap"); | 893 JSONObject jsheap(&jsobj, "heap"); |
| 894 jsheap.AddProperty("usedNew", heap()->UsedInWords(Heap::kNew)); | 894 jsheap.AddProperty("usedNew", heap()->UsedInWords(Heap::kNew)); |
| 895 jsheap.AddProperty("capacityNew", heap()->CapacityInWords(Heap::kNew)); | 895 jsheap.AddProperty("capacityNew", heap()->CapacityInWords(Heap::kNew)); |
| 896 jsheap.AddProperty("usedOld", heap()->UsedInWords(Heap::kOld)); | 896 jsheap.AddProperty("usedOld", heap()->UsedInWords(Heap::kOld)); |
| 897 jsheap.AddProperty("capacityOld", heap()->CapacityInWords(Heap::kOld)); | 897 jsheap.AddProperty("capacityOld", heap()->CapacityInWords(Heap::kOld)); |
| 898 } | 898 } |
| 899 | 899 |
| 900 // TODO(turnidge): Don't compute a full stack trace every time we |
| 901 // request an isolate's info. |
| 900 DebuggerStackTrace* stack = debugger()->StackTrace(); | 902 DebuggerStackTrace* stack = debugger()->StackTrace(); |
| 901 if (stack->Length() > 0) { | 903 if (stack->Length() > 0) { |
| 902 JSONObject jsframe(&jsobj, "topFrame"); | 904 JSONObject jsframe(&jsobj, "topFrame"); |
| 903 | 905 |
| 904 ActivationFrame* frame = stack->FrameAt(0); | 906 ActivationFrame* frame = stack->FrameAt(0); |
| 905 frame->PrintToJSONObject(&jsobj); | 907 frame->PrintToJSONObject(&jsobj); |
| 906 // TODO(turnidge): Implement depth differently -- differentiate | 908 // TODO(turnidge): Implement depth differently -- differentiate |
| 907 // inlined frames. | 909 // inlined frames. |
| 908 jsobj.AddProperty("depth", (intptr_t)0); | 910 jsobj.AddProperty("depth", (intptr_t)0); |
| 909 } | 911 } |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 return func.raw(); | 1096 return func.raw(); |
| 1095 } | 1097 } |
| 1096 | 1098 |
| 1097 | 1099 |
| 1098 void IsolateSpawnState::Cleanup() { | 1100 void IsolateSpawnState::Cleanup() { |
| 1099 SwitchIsolateScope switch_scope(isolate()); | 1101 SwitchIsolateScope switch_scope(isolate()); |
| 1100 Dart::ShutdownIsolate(); | 1102 Dart::ShutdownIsolate(); |
| 1101 } | 1103 } |
| 1102 | 1104 |
| 1103 } // namespace dart | 1105 } // namespace dart |
| OLD | NEW |