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

Unified Diff: runtime/vm/heap.cc

Issue 225303006: Corrected resubmssion of r34736. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/pages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
===================================================================
--- runtime/vm/heap.cc (revision 34741)
+++ runtime/vm/heap.cc (working copy)
@@ -214,6 +214,8 @@
new_space_->Scavenge(invoke_api_callbacks);
RecordAfterGC();
PrintStats();
+ // TODO(koda): Replace promotion failure tracking with
+ // old_space_->NeedsGarbageCollection.
if (new_space_->HadPromotionFailure() || old_space_->NeedExternalGC()) {
// Old collections should call the API callbacks.
CollectGarbage(kOld, kInvokeApiCallbacks);
@@ -467,12 +469,8 @@
stats_.space_ = space;
stats_.reason_ = reason;
stats_.before_.micros_ = OS::GetCurrentTimeMicros();
- stats_.before_.new_used_in_words_ = new_space_->UsedInWords();
- stats_.before_.new_capacity_in_words_ = new_space_->CapacityInWords();
- stats_.before_.new_external_in_words_ = new_space_->ExternalInWords();
- stats_.before_.old_used_in_words_ = old_space_->UsedInWords();
- stats_.before_.old_capacity_in_words_ = old_space_->CapacityInWords();
- stats_.before_.old_external_in_words_ = old_space_->ExternalInWords();
+ stats_.before_.new_ = new_space_->GetCurrentUsage();
+ stats_.before_.old_ = old_space_->GetCurrentUsage();
stats_.times_[0] = 0;
stats_.times_[1] = 0;
stats_.times_[2] = 0;
@@ -494,12 +492,8 @@
old_space_->AddGCTime(delta);
old_space_->IncrementCollections();
}
- stats_.after_.new_used_in_words_ = new_space_->UsedInWords();
- stats_.after_.new_capacity_in_words_ = new_space_->CapacityInWords();
- stats_.after_.new_external_in_words_ = new_space_->ExternalInWords();
- stats_.after_.old_used_in_words_ = old_space_->UsedInWords();
- stats_.after_.old_capacity_in_words_ = old_space_->CapacityInWords();
- stats_.after_.old_external_in_words_ = old_space_->ExternalInWords();
+ stats_.after_.new_ = new_space_->GetCurrentUsage();
+ stats_.after_.old_ = old_space_->GetCurrentUsage();
ASSERT(gc_in_progress_);
gc_in_progress_ = false;
}
@@ -537,18 +531,18 @@
MicrosecondsToSeconds(stats_.before_.micros_ - isolate->start_time()),
MicrosecondsToMilliseconds(stats_.after_.micros_ -
stats_.before_.micros_),
- RoundWordsToKB(stats_.before_.new_used_in_words_),
- RoundWordsToKB(stats_.after_.new_used_in_words_),
- RoundWordsToKB(stats_.before_.new_capacity_in_words_),
- RoundWordsToKB(stats_.after_.new_capacity_in_words_),
- RoundWordsToKB(stats_.before_.new_external_in_words_),
- RoundWordsToKB(stats_.after_.new_external_in_words_),
- RoundWordsToKB(stats_.before_.old_used_in_words_),
- RoundWordsToKB(stats_.after_.old_used_in_words_),
- RoundWordsToKB(stats_.before_.old_capacity_in_words_),
- RoundWordsToKB(stats_.after_.old_capacity_in_words_),
- RoundWordsToKB(stats_.before_.old_external_in_words_),
- RoundWordsToKB(stats_.after_.old_external_in_words_),
+ RoundWordsToKB(stats_.before_.new_.used_in_words),
+ RoundWordsToKB(stats_.after_.new_.used_in_words),
+ RoundWordsToKB(stats_.before_.new_.capacity_in_words),
+ RoundWordsToKB(stats_.after_.new_.capacity_in_words),
+ RoundWordsToKB(stats_.before_.new_.external_in_words),
+ RoundWordsToKB(stats_.after_.new_.external_in_words),
+ RoundWordsToKB(stats_.before_.old_.used_in_words),
+ RoundWordsToKB(stats_.after_.old_.used_in_words),
+ RoundWordsToKB(stats_.before_.old_.capacity_in_words),
+ RoundWordsToKB(stats_.after_.old_.capacity_in_words),
+ RoundWordsToKB(stats_.before_.old_.external_in_words),
+ RoundWordsToKB(stats_.after_.old_.external_in_words),
MicrosecondsToMilliseconds(stats_.times_[0]),
MicrosecondsToMilliseconds(stats_.times_[1]),
MicrosecondsToMilliseconds(stats_.times_[2]),
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698