| 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 | 816 |
| 817 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, | 817 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, |
| 818 bool visit_prologue_weak_handles) { | 818 bool visit_prologue_weak_handles) { |
| 819 if (api_state() != NULL) { | 819 if (api_state() != NULL) { |
| 820 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); | 820 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); |
| 821 } | 821 } |
| 822 } | 822 } |
| 823 | 823 |
| 824 | 824 |
| 825 void Isolate::PrintToJSONStream(JSONStream* stream) { | 825 void Isolate::PrintToJSONStream(JSONStream* stream) { |
| 826 fprintf(stderr, "Printing isolate %" Pd "\n", | |
| 827 static_cast<intptr_t>(main_port())); | |
| 828 JSONObject jsobj(stream); | 826 JSONObject jsobj(stream); |
| 829 jsobj.AddProperty("type", "Isolate"); | 827 jsobj.AddProperty("type", "Isolate"); |
| 830 jsobj.AddPropertyF("id", "isolates/%" Pd "", | 828 jsobj.AddPropertyF("id", "isolates/%" Pd "", |
| 831 static_cast<intptr_t>(main_port())); | 829 static_cast<intptr_t>(main_port())); |
| 832 jsobj.AddPropertyF("name", "%" Pd "", | 830 jsobj.AddPropertyF("name", "%" Pd "", |
| 833 static_cast<intptr_t>(main_port())); | 831 static_cast<intptr_t>(main_port())); |
| 834 IsolateSpawnState* state = spawn_state(); | 832 IsolateSpawnState* state = spawn_state(); |
| 835 if (state != NULL) { | 833 if (state != NULL) { |
| 836 const Object& entry = Object::Handle(this, state->ResolveFunction()); | 834 const Object& entry = Object::Handle(this, state->ResolveFunction()); |
| 837 if (!entry.IsNull() && entry.IsFunction()) { | 835 if (!entry.IsNull() && entry.IsFunction()) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 return func.raw(); | 970 return func.raw(); |
| 973 } | 971 } |
| 974 | 972 |
| 975 | 973 |
| 976 void IsolateSpawnState::Cleanup() { | 974 void IsolateSpawnState::Cleanup() { |
| 977 SwitchIsolateScope switch_scope(isolate()); | 975 SwitchIsolateScope switch_scope(isolate()); |
| 978 Dart::ShutdownIsolate(); | 976 Dart::ShutdownIsolate(); |
| 979 } | 977 } |
| 980 | 978 |
| 981 } // namespace dart | 979 } // namespace dart |
| OLD | NEW |