| 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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 | 911 |
| 912 | 912 |
| 913 bool Isolate::FetchStackFrameDetails() { | 913 bool Isolate::FetchStackFrameDetails() { |
| 914 Isolate* isolate = Isolate::Current(); | 914 Isolate* isolate = Isolate::Current(); |
| 915 ASSERT(isolate->stack_frame_index_ >= 0); | 915 ASSERT(isolate->stack_frame_index_ >= 0); |
| 916 MonitorLocker ml(status_sync); | 916 MonitorLocker ml(status_sync); |
| 917 DebuggerStackTrace* stack = Debugger::CollectStackTrace(); | 917 DebuggerStackTrace* stack = Debugger::CollectStackTrace(); |
| 918 intptr_t frame_index = isolate->stack_frame_index_; | 918 intptr_t frame_index = isolate->stack_frame_index_; |
| 919 if (frame_index >= stack->Length()) { | 919 if (frame_index >= stack->Length()) { |
| 920 // Frame no longer available. | 920 // Frame no longer available. |
| 921 return NULL; | 921 return false; |
| 922 } | 922 } |
| 923 ActivationFrame* frame = stack->FrameAt(frame_index); | 923 ActivationFrame* frame = stack->FrameAt(frame_index); |
| 924 TextBuffer buffer(256); | 924 TextBuffer buffer(256); |
| 925 buffer.Printf("{ \"handle\": \"0x%" Px64 "\", \"frame_index\": %" Pd ", ", | 925 buffer.Printf("{ \"handle\": \"0x%" Px64 "\", \"frame_index\": %" Pd ", ", |
| 926 reinterpret_cast<int64_t>(isolate), frame_index); | 926 reinterpret_cast<int64_t>(isolate), frame_index); |
| 927 | 927 |
| 928 const Code& code = frame->code(); | 928 const Code& code = frame->code(); |
| 929 buffer.Printf("\"code\": { \"size\": %" Pd ", ", code.Size()); | 929 buffer.Printf("\"code\": { \"size\": %" Pd ", ", code.Size()); |
| 930 buffer.Printf("\"alive\": %s, ", code.is_alive() ? "false" : "true"); | 930 buffer.Printf("\"alive\": %s, ", code.is_alive() ? "false" : "true"); |
| 931 buffer.Printf("\"optimized\": %s }, ", | 931 buffer.Printf("\"optimized\": %s }, ", |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 return func.raw(); | 1185 return func.raw(); |
| 1186 } | 1186 } |
| 1187 | 1187 |
| 1188 | 1188 |
| 1189 void IsolateSpawnState::Cleanup() { | 1189 void IsolateSpawnState::Cleanup() { |
| 1190 SwitchIsolateScope switch_scope(isolate()); | 1190 SwitchIsolateScope switch_scope(isolate()); |
| 1191 Dart::ShutdownIsolate(); | 1191 Dart::ShutdownIsolate(); |
| 1192 } | 1192 } |
| 1193 | 1193 |
| 1194 } // namespace dart | 1194 } // namespace dart |
| OLD | NEW |