Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: runtime/vm/isolate.cc

Issue 2809863002: Remove background finalization. (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698