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

Side by Side Diff: runtime/vm/pages.cc

Issue 191743002: Replace RoundMicrosecondsTo* utility. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/pages.h" 5 #include "vm/pages.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/compiler_stats.h" 8 #include "vm/compiler_stats.h"
9 #include "vm/gc_marker.h" 9 #include "vm/gc_marker.h"
10 #include "vm/gc_sweeper.h" 10 #include "vm/gc_sweeper.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 403
404 void PageSpace::PrintToJSONObject(JSONObject* object) { 404 void PageSpace::PrintToJSONObject(JSONObject* object) {
405 JSONObject space(object, "old"); 405 JSONObject space(object, "old");
406 space.AddProperty("type", "PageSpace"); 406 space.AddProperty("type", "PageSpace");
407 space.AddProperty("id", "heaps/old"); 407 space.AddProperty("id", "heaps/old");
408 space.AddProperty("name", "PageSpace"); 408 space.AddProperty("name", "PageSpace");
409 space.AddProperty("user_name", "old"); 409 space.AddProperty("user_name", "old");
410 space.AddProperty("collections", collections()); 410 space.AddProperty("collections", collections());
411 space.AddProperty("used", UsedInWords() * kWordSize); 411 space.AddProperty("used", UsedInWords() * kWordSize);
412 space.AddProperty("capacity", CapacityInWords() * kWordSize); 412 space.AddProperty("capacity", CapacityInWords() * kWordSize);
413 space.AddProperty("time", RoundMicrosecondsToSeconds(gc_time_micros())); 413 space.AddProperty64("time", RoundMicrosecondsToSeconds(gc_time_micros()));
414 } 414 }
415 415
416 416
417 bool PageSpace::ShouldCollectCode() { 417 bool PageSpace::ShouldCollectCode() {
418 // Try to collect code if enough time has passed since the last attempt. 418 // Try to collect code if enough time has passed since the last attempt.
419 const int64_t start = OS::GetCurrentTimeMicros(); 419 const int64_t start = OS::GetCurrentTimeMicros();
420 const int64_t last_code_collection_in_us = 420 const int64_t last_code_collection_in_us =
421 page_space_controller_.last_code_collection_in_us(); 421 page_space_controller_.last_code_collection_in_us();
422 422
423 if ((start - last_code_collection_in_us) > 423 if ((start - last_code_collection_in_us) >
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 return 0; 685 return 0;
686 } else { 686 } else {
687 ASSERT(total_time >= gc_time); 687 ASSERT(total_time >= gc_time);
688 int result= static_cast<int>((static_cast<double>(gc_time) / 688 int result= static_cast<int>((static_cast<double>(gc_time) /
689 static_cast<double>(total_time)) * 100); 689 static_cast<double>(total_time)) * 100);
690 return result; 690 return result;
691 } 691 }
692 } 692 }
693 693
694 } // namespace dart 694 } // namespace dart
OLDNEW
« runtime/platform/globals.h ('K') | « runtime/vm/heap.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698