| 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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 if (state != NULL) { | 895 if (state != NULL) { |
| 896 const Object& entry = Object::Handle(this, state->ResolveFunction()); | 896 const Object& entry = Object::Handle(this, state->ResolveFunction()); |
| 897 if (!entry.IsNull() && entry.IsFunction()) { | 897 if (!entry.IsNull() && entry.IsFunction()) { |
| 898 Function& func = Function::Handle(this); | 898 Function& func = Function::Handle(this); |
| 899 func ^= entry.raw(); | 899 func ^= entry.raw(); |
| 900 jsobj.AddProperty("entry", func); | 900 jsobj.AddProperty("entry", func); |
| 901 } | 901 } |
| 902 } | 902 } |
| 903 { | 903 { |
| 904 JSONObject jsheap(&jsobj, "heap"); | 904 JSONObject jsheap(&jsobj, "heap"); |
| 905 jsheap.AddProperty("usedNew", heap()->UsedInWords(Heap::kNew)); | 905 jsheap.AddProperty("usedNew", |
| 906 jsheap.AddProperty("capacityNew", heap()->CapacityInWords(Heap::kNew)); | 906 heap()->UsedInWords(Heap::kNew) * kWordSize); |
| 907 jsheap.AddProperty("usedOld", heap()->UsedInWords(Heap::kOld)); | 907 jsheap.AddProperty("capacityNew", |
| 908 jsheap.AddProperty("capacityOld", heap()->CapacityInWords(Heap::kOld)); | 908 heap()->CapacityInWords(Heap::kNew) * kWordSize); |
| 909 jsheap.AddProperty("usedOld", |
| 910 heap()->UsedInWords(Heap::kOld) * kWordSize); |
| 911 jsheap.AddProperty("capacityOld", |
| 912 heap()->CapacityInWords(Heap::kOld) * kWordSize); |
| 909 } | 913 } |
| 910 | 914 |
| 911 // TODO(turnidge): Don't compute a full stack trace every time we | 915 // TODO(turnidge): Don't compute a full stack trace every time we |
| 912 // request an isolate's info. | 916 // request an isolate's info. |
| 913 DebuggerStackTrace* stack = debugger()->StackTrace(); | 917 DebuggerStackTrace* stack = debugger()->StackTrace(); |
| 914 if (stack->Length() > 0) { | 918 if (stack->Length() > 0) { |
| 915 JSONObject jsframe(&jsobj, "topFrame"); | 919 JSONObject jsframe(&jsobj, "topFrame"); |
| 916 | 920 |
| 917 ActivationFrame* frame = stack->FrameAt(0); | 921 ActivationFrame* frame = stack->FrameAt(0); |
| 918 frame->PrintToJSONObject(&jsobj); | 922 frame->PrintToJSONObject(&jsobj); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 return func.raw(); | 1137 return func.raw(); |
| 1134 } | 1138 } |
| 1135 | 1139 |
| 1136 | 1140 |
| 1137 void IsolateSpawnState::Cleanup() { | 1141 void IsolateSpawnState::Cleanup() { |
| 1138 SwitchIsolateScope switch_scope(isolate()); | 1142 SwitchIsolateScope switch_scope(isolate()); |
| 1139 Dart::ShutdownIsolate(); | 1143 Dart::ShutdownIsolate(); |
| 1140 } | 1144 } |
| 1141 | 1145 |
| 1142 } // namespace dart | 1146 } // namespace dart |
| OLD | NEW |