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

Unified Diff: runtime/vm/dart_api_state.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_state.h ('k') | runtime/vm/flag_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_state.cc
diff --git a/runtime/vm/dart_api_state.cc b/runtime/vm/dart_api_state.cc
index d5d0d3b7b0808e792a50923a7b44e9a125051102..ba2359b61672a307af8347ef53c804bc1a760ac9 100644
--- a/runtime/vm/dart_api_state.cc
+++ b/runtime/vm/dart_api_state.cc
@@ -16,40 +16,4 @@ namespace dart {
intptr_t ApiNativeScope::current_memory_usage_ = 0;
-BackgroundFinalizer::BackgroundFinalizer(Isolate* isolate,
- FinalizationQueue* queue)
- : isolate_(isolate), queue_(queue) {
- ASSERT(FLAG_background_finalization);
- PageSpace* old_space = isolate->heap()->old_space();
- MonitorLocker ml(old_space->tasks_lock());
- old_space->set_tasks(old_space->tasks() + 1);
-}
-
-
-void BackgroundFinalizer::Run() {
- bool result = Thread::EnterIsolateAsHelper(isolate_, Thread::kFinalizerTask);
- ASSERT(result);
-
- {
- Thread* thread = Thread::Current();
- TIMELINE_FUNCTION_GC_DURATION(thread, "BackgroundFinalization");
- TransitionVMToNative transition(thread);
- for (intptr_t i = 0; i < queue_->length(); i++) {
- FinalizablePersistentHandle* handle = (*queue_)[i];
- FinalizablePersistentHandle::Finalize(isolate_, handle);
- }
- delete queue_;
- }
-
- // Exit isolate cleanly *before* notifying it, to avoid shutdown race.
- Thread::ExitIsolateAsHelper();
-
- {
- PageSpace* old_space = isolate_->heap()->old_space();
- MonitorLocker ml(old_space->tasks_lock());
- old_space->set_tasks(old_space->tasks() - 1);
- ml.NotifyAll();
- }
-}
-
} // namespace dart
« no previous file with comments | « runtime/vm/dart_api_state.h ('k') | runtime/vm/flag_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698