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

Unified Diff: runtime/vm/gc_marker.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/flag_list.h ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/gc_marker.cc
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index a6d1548671dd3da103cd25dcc5a4b244041720b7..fd1a1f25b8f5cde5d8e2344770429ba55bac27ac 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -430,21 +430,18 @@ static bool IsUnreachable(const RawObject* raw_obj) {
class MarkingWeakVisitor : public HandleVisitor {
public:
- MarkingWeakVisitor(Thread* thread, FinalizationQueue* queue)
- : HandleVisitor(thread), queue_(queue) {}
+ explicit MarkingWeakVisitor(Thread* thread) : HandleVisitor(thread) {}
void VisitHandle(uword addr) {
FinalizablePersistentHandle* handle =
reinterpret_cast<FinalizablePersistentHandle*>(addr);
RawObject* raw_obj = handle->raw();
if (IsUnreachable(raw_obj)) {
- handle->UpdateUnreachable(thread()->isolate(), queue_);
+ handle->UpdateUnreachable(thread()->isolate());
}
}
private:
- FinalizationQueue* queue_;
-
DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor);
};
@@ -711,19 +708,8 @@ void GCMarker::MarkObjects(Isolate* isolate,
mark.DrainMarkingStack();
{
TIMELINE_FUNCTION_GC_DURATION(thread, "WeakHandleProcessing");
- if (FLAG_background_finalization) {
- FinalizationQueue* queue = new FinalizationQueue();
- MarkingWeakVisitor mark_weak(thread, queue);
- IterateWeakRoots(isolate, &mark_weak);
- if (queue->length() > 0) {
- Dart::thread_pool()->Run(new BackgroundFinalizer(isolate, queue));
- } else {
- delete queue;
- }
- } else {
- MarkingWeakVisitor mark_weak(thread, NULL);
- IterateWeakRoots(isolate, &mark_weak);
- }
+ MarkingWeakVisitor mark_weak(thread);
+ IterateWeakRoots(isolate, &mark_weak);
}
// All marking done; detach code, etc.
FinalizeResultsFrom(&mark);
@@ -764,19 +750,8 @@ void GCMarker::MarkObjects(Isolate* isolate,
// Phase 2: Weak processing on main thread.
{
TIMELINE_FUNCTION_GC_DURATION(thread, "WeakHandleProcessing");
- if (FLAG_background_finalization) {
- FinalizationQueue* queue = new FinalizationQueue();
- MarkingWeakVisitor mark_weak(thread, queue);
- IterateWeakRoots(isolate, &mark_weak);
- if (queue->length() > 0) {
- Dart::thread_pool()->Run(new BackgroundFinalizer(isolate, queue));
- } else {
- delete queue;
- }
- } else {
- MarkingWeakVisitor mark_weak(thread, NULL);
- IterateWeakRoots(isolate, &mark_weak);
- }
+ MarkingWeakVisitor mark_weak(thread);
+ IterateWeakRoots(isolate, &mark_weak);
}
barrier.Sync();
« no previous file with comments | « runtime/vm/flag_list.h ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698