| 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 "vm/code_observers.h" | 10 #include "vm/code_observers.h" |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 ASSERT(this == Isolate::Current()); | 1067 ASSERT(this == Isolate::Current()); |
| 1068 ASSERT(top_resource() == NULL); | 1068 ASSERT(top_resource() == NULL); |
| 1069 #if defined(DEBUG) | 1069 #if defined(DEBUG) |
| 1070 if (heap_ != NULL) { | 1070 if (heap_ != NULL) { |
| 1071 // Wait for concurrent GC tasks to finish before final verification. | 1071 // Wait for concurrent GC tasks to finish before final verification. |
| 1072 PageSpace* old_space = heap_->old_space(); | 1072 PageSpace* old_space = heap_->old_space(); |
| 1073 MonitorLocker ml(old_space->tasks_lock()); | 1073 MonitorLocker ml(old_space->tasks_lock()); |
| 1074 while (old_space->tasks() > 0) { | 1074 while (old_space->tasks() > 0) { |
| 1075 ml.Wait(); | 1075 ml.Wait(); |
| 1076 } | 1076 } |
| 1077 heap_->Verify(kForbidMarked); | 1077 // The VM isolate keeps all objects marked. |
| 1078 heap_->Verify(this == Dart::vm_isolate() ? kRequireMarked : kForbidMarked); |
| 1078 } | 1079 } |
| 1079 #endif // DEBUG | 1080 #endif // DEBUG |
| 1080 | 1081 |
| 1081 // Remove this isolate from the list *before* we start tearing it down, to | 1082 // Remove this isolate from the list *before* we start tearing it down, to |
| 1082 // avoid exposing it in a state of decay. | 1083 // avoid exposing it in a state of decay. |
| 1083 RemoveIsolateFromList(this); | 1084 RemoveIsolateFromList(this); |
| 1084 | 1085 |
| 1085 // Create an area where we do have a zone and a handle scope so that we can | 1086 // Create an area where we do have a zone and a handle scope so that we can |
| 1086 // call VM functions while tearing this isolate down. | 1087 // call VM functions while tearing this isolate down. |
| 1087 { | 1088 { |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 serialized_message_, serialized_message_len_); | 1631 serialized_message_, serialized_message_len_); |
| 1631 } | 1632 } |
| 1632 | 1633 |
| 1633 | 1634 |
| 1634 void IsolateSpawnState::Cleanup() { | 1635 void IsolateSpawnState::Cleanup() { |
| 1635 SwitchIsolateScope switch_scope(I); | 1636 SwitchIsolateScope switch_scope(I); |
| 1636 Dart::ShutdownIsolate(); | 1637 Dart::ShutdownIsolate(); |
| 1637 } | 1638 } |
| 1638 | 1639 |
| 1639 } // namespace dart | 1640 } // namespace dart |
| OLD | NEW |