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

Unified Diff: runtime/vm/scavenger.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/profiler.h ('k') | runtime/vm/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index f68145990d582f609f570401a232c8630bebb2d9..306a78a4978ac104cb62f3d870690a344235ff12 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -193,13 +193,10 @@ class ScavengerVisitor : public ObjectPointerVisitor {
class ScavengerWeakVisitor : public HandleVisitor {
public:
- ScavengerWeakVisitor(Thread* thread,
- Scavenger* scavenger,
- FinalizationQueue* finalization_queue) :
- HandleVisitor(thread),
- scavenger_(scavenger),
- queue_(finalization_queue) {
- ASSERT(scavenger->heap_->isolate() == thread->isolate());
+ explicit ScavengerWeakVisitor(Scavenger* scavenger)
+ : HandleVisitor(Thread::Current()),
+ scavenger_(scavenger) {
+ ASSERT(scavenger->heap_->isolate() == Thread::Current()->isolate());
}
void VisitHandle(uword addr) {
@@ -207,7 +204,7 @@ class ScavengerWeakVisitor : public HandleVisitor {
reinterpret_cast<FinalizablePersistentHandle*>(addr);
RawObject** p = handle->raw_addr();
if (scavenger_->IsUnreachable(p)) {
- handle->UpdateUnreachable(thread()->isolate(), queue_);
+ handle->UpdateUnreachable(thread()->isolate());
} else {
handle->UpdateRelocated(thread()->isolate());
}
@@ -215,7 +212,6 @@ class ScavengerWeakVisitor : public HandleVisitor {
private:
Scavenger* scavenger_;
- FinalizationQueue* queue_;
DISALLOW_COPY_AND_ASSIGN(ScavengerWeakVisitor);
};
@@ -816,14 +812,8 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
int64_t middle = OS::GetCurrentTimeMicros();
{
TIMELINE_FUNCTION_GC_DURATION(thread, "WeakHandleProcessing");
- FinalizationQueue* queue = new FinalizationQueue();
- ScavengerWeakVisitor weak_visitor(thread, this, queue);
+ ScavengerWeakVisitor weak_visitor(this);
IterateWeakRoots(isolate, &weak_visitor);
- if (queue->length() > 0) {
- Dart::thread_pool()->Run(new BackgroundFinalizer(isolate, queue));
- } else {
- delete queue;
- }
}
ProcessWeakReferences();
page_space->ReleaseDataLock();
« no previous file with comments | « runtime/vm/profiler.h ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698