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

Unified Diff: runtime/vm/pages.cc

Issue 2582543003: Update GC stats, ThreadPool, Timer and ScopedTimer to use monotonic time. (Closed)
Patch Set: . Created 4 years 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/heap.cc ('k') | runtime/vm/scavenger.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 8ddb372f8245b0477e86dcd9ac34602dbdebb861..268bebf42f3e93d456809eb0734b2e099a735645 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -776,7 +776,7 @@ void PageSpace::PrintHeapMapToJSONStream(Isolate* isolate,
bool PageSpace::ShouldCollectCode() {
// Try to collect code if enough time has passed since the last attempt.
- const int64_t start = OS::GetCurrentTimeMicros();
+ const int64_t start = OS::GetCurrentMonotonicMicros();
const int64_t last_code_collection_in_us =
page_space_controller_.last_code_collection_in_us();
@@ -852,7 +852,7 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
OS::PrintErr(" done.\n");
}
- const int64_t start = OS::GetCurrentTimeMicros();
+ const int64_t start = OS::GetCurrentMonotonicMicros();
// Make code pages writable.
WriteProtectCode(false);
@@ -867,7 +867,7 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
marker.MarkObjects(isolate, this, invoke_api_callbacks, collect_code);
usage_.used_in_words = marker.marked_words();
- int64_t mid1 = OS::GetCurrentTimeMicros();
+ int64_t mid1 = OS::GetCurrentMonotonicMicros();
// Abandon the remainder of the bump allocation block.
AbandonBumpAllocation();
@@ -875,7 +875,7 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
freelist_[HeapPage::kData].Reset();
freelist_[HeapPage::kExecutable].Reset();
- int64_t mid2 = OS::GetCurrentTimeMicros();
+ int64_t mid2 = OS::GetCurrentMonotonicMicros();
int64_t mid3 = 0;
{
@@ -922,7 +922,7 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
page = next_page;
}
- mid3 = OS::GetCurrentTimeMicros();
+ mid3 = OS::GetCurrentMonotonicMicros();
if (!FLAG_concurrent_sweep) {
// Sweep all regular sized pages now.
@@ -955,7 +955,7 @@ void PageSpace::MarkSweep(bool invoke_api_callbacks) {
// Make code pages read-only.
WriteProtectCode(true);
- int64_t end = OS::GetCurrentTimeMicros();
+ int64_t end = OS::GetCurrentMonotonicMicros();
// Record signals for growth control. Include size of external allocations.
page_space_controller_.EvaluateGarbageCollection(
@@ -1117,7 +1117,7 @@ PageSpaceController::PageSpaceController(Heap* heap,
desired_utilization_((100.0 - heap_growth_ratio) / 100.0),
heap_growth_max_(heap_growth_max),
garbage_collection_time_ratio_(garbage_collection_time_ratio),
- last_code_collection_in_us_(OS::GetCurrentTimeMicros()) {}
+ last_code_collection_in_us_(OS::GetCurrentMonotonicMicros()) {}
PageSpaceController::~PageSpaceController() {}
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698