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 "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/text_buffer.h" | 10 #include "platform/text_buffer.h" |
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 } | 1598 } |
1599 | 1599 |
1600 | 1600 |
1601 class FinalizeWeakPersistentHandlesVisitor : public HandleVisitor { | 1601 class FinalizeWeakPersistentHandlesVisitor : public HandleVisitor { |
1602 public: | 1602 public: |
1603 FinalizeWeakPersistentHandlesVisitor() : HandleVisitor(Thread::Current()) {} | 1603 FinalizeWeakPersistentHandlesVisitor() : HandleVisitor(Thread::Current()) {} |
1604 | 1604 |
1605 void VisitHandle(uword addr) { | 1605 void VisitHandle(uword addr) { |
1606 FinalizablePersistentHandle* handle = | 1606 FinalizablePersistentHandle* handle = |
1607 reinterpret_cast<FinalizablePersistentHandle*>(addr); | 1607 reinterpret_cast<FinalizablePersistentHandle*>(addr); |
1608 FinalizationQueue* queue = NULL; // Finalize in the foreground. | 1608 handle->UpdateUnreachable(thread()->isolate()); |
1609 handle->UpdateUnreachable(thread()->isolate(), queue); | |
1610 } | 1609 } |
1611 | 1610 |
1612 private: | 1611 private: |
1613 DISALLOW_COPY_AND_ASSIGN(FinalizeWeakPersistentHandlesVisitor); | 1612 DISALLOW_COPY_AND_ASSIGN(FinalizeWeakPersistentHandlesVisitor); |
1614 }; | 1613 }; |
1615 | 1614 |
1616 | 1615 |
1617 void Isolate::LowLevelShutdown() { | 1616 void Isolate::LowLevelShutdown() { |
1618 // Ensure we have a zone and handle scope so that we can call VM functions, | 1617 // Ensure we have a zone and handle scope so that we can call VM functions, |
1619 // but we no longer allocate new heap objects. | 1618 // but we no longer allocate new heap objects. |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2947 void IsolateSpawnState::DecrementSpawnCount() { | 2946 void IsolateSpawnState::DecrementSpawnCount() { |
2948 ASSERT(spawn_count_monitor_ != NULL); | 2947 ASSERT(spawn_count_monitor_ != NULL); |
2949 ASSERT(spawn_count_ != NULL); | 2948 ASSERT(spawn_count_ != NULL); |
2950 MonitorLocker ml(spawn_count_monitor_); | 2949 MonitorLocker ml(spawn_count_monitor_); |
2951 ASSERT(*spawn_count_ > 0); | 2950 ASSERT(*spawn_count_ > 0); |
2952 *spawn_count_ = *spawn_count_ - 1; | 2951 *spawn_count_ = *spawn_count_ - 1; |
2953 ml.Notify(); | 2952 ml.Notify(); |
2954 } | 2953 } |
2955 | 2954 |
2956 } // namespace dart | 2955 } // namespace dart |
OLD | NEW |