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

Unified Diff: runtime/vm/scavenger.cc

Issue 2010673002: Add timeline event for weak handle processing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/gc_marker.cc ('k') | no next file » | 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 3a5bb3f1deb34d574f866c8dfd421d558339e964..03f0912a395582ebf2fa1d531941916b0d002ded 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -14,6 +14,7 @@
#include "vm/stack_frame.h"
#include "vm/store_buffer.h"
#include "vm/thread_registry.h"
+#include "vm/timeline.h"
#include "vm/verified_memory.h"
#include "vm/verifier.h"
#include "vm/visitor.h"
@@ -778,7 +779,8 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
// will continue with its scavenge after waiting for the winner to complete.
// TODO(koda): Consider moving SafepointThreads into allocation failure/retry
// logic to avoid needless collections.
- SafepointOperationScope safepoint_scope(Thread::Current());
+ Thread* thread = Thread::Current();
+ SafepointOperationScope safepoint_scope(thread);
// Scavenging is not reentrant. Make sure that is the case.
ASSERT(!scavenging_);
@@ -802,7 +804,7 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
// The API prologue/epilogue may create/destroy zones, so we must not
// depend on zone allocations surviving beyond the epilogue callback.
{
- StackZone zone(Thread::Current());
+ StackZone zone(thread);
// Setup the visitor and run the scavenge.
ScavengerVisitor visitor(isolate, this, from);
page_space->AcquireDataLock();
@@ -810,8 +812,11 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
int64_t start = OS::GetCurrentTimeMicros();
ProcessToSpace(&visitor);
int64_t middle = OS::GetCurrentTimeMicros();
- ScavengerWeakVisitor weak_visitor(this);
- IterateWeakRoots(isolate, &weak_visitor);
+ {
+ TIMELINE_FUNCTION_GC_DURATION(thread, "WeakHandleProcessing");
+ ScavengerWeakVisitor weak_visitor(this);
+ IterateWeakRoots(isolate, &weak_visitor);
+ }
ProcessWeakReferences();
page_space->ReleaseDataLock();
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698