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

Unified Diff: runtime/vm/gc_marker.cc

Issue 2041373004: Revert "Background finalization." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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.cc ('k') | runtime/vm/heap.h » ('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 0b302cec79fb011d8c5dfc97364e0fdbf52646e5..069f34175990a492b4c75280f2062e1e58ad0153 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -422,21 +422,19 @@ static bool IsUnreachable(const RawObject* raw_obj) {
class MarkingWeakVisitor : public HandleVisitor {
public:
- MarkingWeakVisitor(Thread* thread, FinalizationQueue* queue) :
- HandleVisitor(thread), queue_(queue) { }
+ MarkingWeakVisitor() : HandleVisitor(Thread::Current()) {
+ }
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);
};
@@ -670,14 +668,8 @@ void GCMarker::MarkObjects(Isolate* isolate,
mark.DrainMarkingStack();
{
TIMELINE_FUNCTION_GC_DURATION(thread, "WeakHandleProcessing");
- FinalizationQueue* queue = new FinalizationQueue();
- MarkingWeakVisitor mark_weak(thread, queue);
+ MarkingWeakVisitor mark_weak;
IterateWeakRoots(isolate, &mark_weak);
- if (queue->length() > 0) {
- Dart::thread_pool()->Run(new BackgroundFinalizer(isolate, queue));
- } else {
- delete queue;
- }
}
// All marking done; detach code, etc.
FinalizeResultsFrom(&mark);
@@ -701,14 +693,8 @@ void GCMarker::MarkObjects(Isolate* isolate,
// Phase 2: Weak processing on main thread.
{
TIMELINE_FUNCTION_GC_DURATION(thread, "WeakHandleProcessing");
- FinalizationQueue* queue = new FinalizationQueue();
- MarkingWeakVisitor mark_weak(thread, queue);
+ MarkingWeakVisitor mark_weak;
IterateWeakRoots(isolate, &mark_weak);
- if (queue->length() > 0) {
- Dart::thread_pool()->Run(new BackgroundFinalizer(isolate, queue));
- } else {
- delete queue;
- }
}
barrier.Sync();
« no previous file with comments | « runtime/vm/dart_api_state.cc ('k') | runtime/vm/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698