| 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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 } | 1002 } |
| 1003 | 1003 |
| 1004 private: | 1004 private: |
| 1005 DISALLOW_COPY_AND_ASSIGN(FinalizeWeakPersistentHandlesVisitor); | 1005 DISALLOW_COPY_AND_ASSIGN(FinalizeWeakPersistentHandlesVisitor); |
| 1006 }; | 1006 }; |
| 1007 | 1007 |
| 1008 | 1008 |
| 1009 void Isolate::Shutdown() { | 1009 void Isolate::Shutdown() { |
| 1010 ASSERT(this == Isolate::Current()); | 1010 ASSERT(this == Isolate::Current()); |
| 1011 ASSERT(top_resource() == NULL); | 1011 ASSERT(top_resource() == NULL); |
| 1012 ASSERT((heap_ == NULL) || heap_->Verify()); | 1012 #if defined(DEBUG) |
| 1013 if (heap_ != NULL) { |
| 1014 // Wait for concurrent GC tasks to finish before final verification. |
| 1015 PageSpace* old_space = heap_->old_space(); |
| 1016 MonitorLocker ml(old_space->tasks_lock()); |
| 1017 while (old_space->tasks() > 0) { |
| 1018 ml.Wait(); |
| 1019 } |
| 1020 heap_->Verify(kForbidMarked); |
| 1021 } |
| 1022 #endif // DEBUG |
| 1013 | 1023 |
| 1014 // Remove this isolate from the list *before* we start tearing it down, to | 1024 // Remove this isolate from the list *before* we start tearing it down, to |
| 1015 // avoid exposing it in a state of decay. | 1025 // avoid exposing it in a state of decay. |
| 1016 RemoveIsolateFromList(this); | 1026 RemoveIsolateFromList(this); |
| 1017 | 1027 |
| 1018 // Create an area where we do have a zone and a handle scope so that we can | 1028 // Create an area where we do have a zone and a handle scope so that we can |
| 1019 // call VM functions while tearing this isolate down. | 1029 // call VM functions while tearing this isolate down. |
| 1020 { | 1030 { |
| 1021 StackZone stack_zone(this); | 1031 StackZone stack_zone(this); |
| 1022 HandleScope handle_scope(this); | 1032 HandleScope handle_scope(this); |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 serialized_message_, serialized_message_len_); | 1581 serialized_message_, serialized_message_len_); |
| 1572 } | 1582 } |
| 1573 | 1583 |
| 1574 | 1584 |
| 1575 void IsolateSpawnState::Cleanup() { | 1585 void IsolateSpawnState::Cleanup() { |
| 1576 SwitchIsolateScope switch_scope(I); | 1586 SwitchIsolateScope switch_scope(I); |
| 1577 Dart::ShutdownIsolate(); | 1587 Dart::ShutdownIsolate(); |
| 1578 } | 1588 } |
| 1579 | 1589 |
| 1580 } // namespace dart | 1590 } // namespace dart |
| OLD | NEW |