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

Unified Diff: runtime/vm/pages.cc

Issue 2583663002: Internally measure isolate uptime with 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/os_test.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 4fb4efbc83e487722bfd602fd5329815239bbc77..8ddb372f8245b0477e86dcd9ac34602dbdebb861 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -704,7 +704,7 @@ void PageSpace::PrintToJSONObject(JSONObject* object) const {
space.AddProperty64("external", ExternalInWords() * kWordSize);
space.AddProperty("time", MicrosecondsToSeconds(gc_time_micros()));
if (collections() > 0) {
- int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time();
+ int64_t run_time = isolate->UptimeMicros();
run_time = Utils::Maximum(run_time, static_cast<int64_t>(0));
double run_time_millis = MicrosecondsToMilliseconds(run_time);
double avg_time_between_collections =
@@ -1144,8 +1144,8 @@ bool PageSpaceController::NeedsGarbageCollection(SpaceUsage after) const {
// kInitialTimeoutSeconds, gradually lower the capacity limit.
static const double kInitialTimeoutSeconds = 1.00;
if (history_.IsEmpty()) {
- double seconds_since_init = MicrosecondsToSeconds(
- OS::GetCurrentTimeMicros() - heap_->isolate()->start_time());
+ double seconds_since_init =
+ MicrosecondsToSeconds(heap_->isolate()->UptimeMicros());
if (seconds_since_init > kInitialTimeoutSeconds) {
multiplier *= seconds_since_init / kInitialTimeoutSeconds;
}
« no previous file with comments | « runtime/vm/os_test.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698