| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 stack_overflow_count_(0), | 344 stack_overflow_count_(0), |
| 345 message_handler_(NULL), | 345 message_handler_(NULL), |
| 346 spawn_state_(NULL), | 346 spawn_state_(NULL), |
| 347 is_runnable_(false), | 347 is_runnable_(false), |
| 348 gc_prologue_callback_(NULL), | 348 gc_prologue_callback_(NULL), |
| 349 gc_epilogue_callback_(NULL), | 349 gc_epilogue_callback_(NULL), |
| 350 defer_finalization_count_(0), | 350 defer_finalization_count_(0), |
| 351 deopt_context_(NULL), | 351 deopt_context_(NULL), |
| 352 stacktrace_(NULL), | 352 stacktrace_(NULL), |
| 353 stack_frame_index_(-1), | 353 stack_frame_index_(-1), |
| 354 last_allocationprofile_accumulator_reset_timestamp_(0), |
| 355 last_allocationprofile_gc_timestamp_(0), |
| 354 cha_used_(false), | 356 cha_used_(false), |
| 355 object_id_ring_(NULL), | 357 object_id_ring_(NULL), |
| 356 trace_buffer_(NULL), | 358 trace_buffer_(NULL), |
| 357 profiler_data_(NULL), | 359 profiler_data_(NULL), |
| 358 thread_state_(NULL), | 360 thread_state_(NULL), |
| 359 tag_table_(GrowableObjectArray::null()), | 361 tag_table_(GrowableObjectArray::null()), |
| 360 current_tag_(UserTag::null()), | 362 current_tag_(UserTag::null()), |
| 361 next_(NULL), | 363 next_(NULL), |
| 362 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) | 364 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) |
| 363 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) | 365 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 } | 931 } |
| 930 if (state != NULL) { | 932 if (state != NULL) { |
| 931 const Object& entry = Object::Handle(this, state->ResolveFunction()); | 933 const Object& entry = Object::Handle(this, state->ResolveFunction()); |
| 932 if (!entry.IsNull() && entry.IsFunction()) { | 934 if (!entry.IsNull() && entry.IsFunction()) { |
| 933 Function& func = Function::Handle(this); | 935 Function& func = Function::Handle(this); |
| 934 func ^= entry.raw(); | 936 func ^= entry.raw(); |
| 935 jsobj.AddProperty("entry", func); | 937 jsobj.AddProperty("entry", func); |
| 936 } | 938 } |
| 937 } | 939 } |
| 938 { | 940 { |
| 939 JSONObject jsheap(&jsobj, "heap"); | 941 JSONObject jsheap(&jsobj, "heaps"); |
| 940 jsheap.AddProperty("usedNew", | 942 heap()->PrintToJSONObject(Heap::kNew, &jsheap); |
| 941 heap()->UsedInWords(Heap::kNew) * kWordSize); | 943 heap()->PrintToJSONObject(Heap::kOld, &jsheap); |
| 942 jsheap.AddProperty("capacityNew", | |
| 943 heap()->CapacityInWords(Heap::kNew) * kWordSize); | |
| 944 jsheap.AddProperty("usedOld", | |
| 945 heap()->UsedInWords(Heap::kOld) * kWordSize); | |
| 946 jsheap.AddProperty("capacityOld", | |
| 947 heap()->CapacityInWords(Heap::kOld) * kWordSize); | |
| 948 } | 944 } |
| 949 | 945 |
| 950 // TODO(turnidge): Don't compute a full stack trace every time we | 946 // TODO(turnidge): Don't compute a full stack trace every time we |
| 951 // request an isolate's info. | 947 // request an isolate's info. |
| 952 DebuggerStackTrace* stack = debugger()->StackTrace(); | 948 DebuggerStackTrace* stack = debugger()->StackTrace(); |
| 953 if (stack->Length() > 0) { | 949 if (stack->Length() > 0) { |
| 954 JSONObject jsframe(&jsobj, "topFrame"); | 950 JSONObject jsframe(&jsobj, "topFrame"); |
| 955 | 951 |
| 956 ActivationFrame* frame = stack->FrameAt(0); | 952 ActivationFrame* frame = stack->FrameAt(0); |
| 957 frame->PrintToJSONObject(&jsobj); | 953 frame->PrintToJSONObject(&jsobj); |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 return func.raw(); | 1236 return func.raw(); |
| 1241 } | 1237 } |
| 1242 | 1238 |
| 1243 | 1239 |
| 1244 void IsolateSpawnState::Cleanup() { | 1240 void IsolateSpawnState::Cleanup() { |
| 1245 SwitchIsolateScope switch_scope(isolate()); | 1241 SwitchIsolateScope switch_scope(isolate()); |
| 1246 Dart::ShutdownIsolate(); | 1242 Dart::ShutdownIsolate(); |
| 1247 } | 1243 } |
| 1248 | 1244 |
| 1249 } // namespace dart | 1245 } // namespace dart |
| OLD | NEW |