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

Unified Diff: runtime/vm/pages.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/pages.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 9768bc5f2510fad9045046e9a9564144c5968753..ce8bf42aad31e8753f932ecd339d16d25e061af0 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -849,6 +849,8 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
Isolate* isolate = heap_->isolate();
ASSERT(isolate == Isolate::Current());
+ const int64_t pre_wait_for_sweepers = OS::GetCurrentMonotonicMicros();
+
// Wait for pending tasks to complete and then account for the driver task.
{
MonitorLocker locker(tasks_lock());
@@ -857,6 +859,9 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
}
set_tasks(1);
}
+
+ const int64_t pre_safe_point = OS::GetCurrentMonotonicMicros();
+
// Ensure that all threads for this isolate are at a safepoint (either
// stopped or in native code). We have guards around Newgen GC and oldgen GC
// to ensure that if two threads are racing to collect at the same time the
@@ -864,6 +869,8 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
{
SafepointOperationScope safepoint_scope(thread);
+ const int64_t start = OS::GetCurrentMonotonicMicros();
+
// Perform various cleanup that relies on no tasks interfering.
isolate->class_table()->FreeOldTables();
@@ -882,8 +889,6 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
OS::PrintErr(" done.\n");
}
- const int64_t start = OS::GetCurrentMonotonicMicros();
-
// Make code pages writable.
WriteProtectCode(false);
@@ -991,6 +996,8 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
page_space_controller_.EvaluateGarbageCollection(
usage_before, GetCurrentUsage(), start, end);
+ heap_->RecordTime(kConcurrentSweep, pre_safe_point - pre_wait_for_sweepers);
+ heap_->RecordTime(kSafePoint, start - pre_safe_point);
heap_->RecordTime(kMarkObjects, mid1 - start);
heap_->RecordTime(kResetFreeLists, mid2 - mid1);
heap_->RecordTime(kSweepPages, mid3 - mid2);
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698