| 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();
|
|
|
|
|