| 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);
|
|
|