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

Unified Diff: runtime/vm/scavenger.cc

Issue 2771013002: Add more safe points in compiler (Closed)
Patch Set: Fix test that 'parses' verbose GC output 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
« no previous file with comments | « runtime/vm/scavenger.h ('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 f728f6b967aba3b50bd1975f3de77c8f7516cd3b..4fa81d926f661b5918bbfc394fc3bcee12d5b2c6 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -517,6 +517,7 @@ void Scavenger::IterateRoots(Isolate* isolate, ScavengerVisitor* visitor) {
heap_->RecordData(kToKBAfterStoreBuffer, RoundWordsToKB(UsedInWords()));
heap_->RecordTime(kVisitIsolateRoots, middle - start);
heap_->RecordTime(kIterateStoreBuffers, end - middle);
+ heap_->RecordTime(kDummyScavengeTime, 0);
}
@@ -781,6 +782,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 +795,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...");
« no previous file with comments | « runtime/vm/scavenger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698