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

Unified Diff: runtime/vm/scavenger.cc

Issue 2771013002: Add more safe points in compiler (Closed)
Patch Set: Add a safe point in the zone allocator Created 3 years, 9 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
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index f728f6b967aba3b50bd1975f3de77c8f7516cd3b..7887d4f27a01dc1dde130dbdbc6f6319672baad9 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -781,6 +781,9 @@ 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.
+
+ int64_t pre_safe_point = OS::GetCurrentMonotonicMicros();
+
Thread* thread = Thread::Current();
SafepointOperationScope safepoint_scope(thread);
@@ -791,6 +794,9 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
PageSpace* page_space = heap_->old_space();
NoSafepointScope no_safepoints;
+ int64_t post_safe_point = OS::GetCurrentMonotonicMicros();
+ heap_->RecordTime(kSafePoint, post_safe_point - pre_safe_point);
+
// TODO(koda): Make verification more compatible with concurrent sweep.
if (FLAG_verify_before_gc && !FLAG_concurrent_sweep) {
OS::PrintErr("Verifying before Scavenge...");

Powered by Google App Engine
This is Rietveld 408576698