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

Unified Diff: runtime/vm/scavenger.cc

Issue 11783015: Restore the bytes promoted counter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index f6273457278a9649199f5d958cdc28428cca6212..047c5fb0a54ccaff2b0c9840cdf83b61575cac0f 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -74,6 +74,7 @@ class ScavengerVisitor : public ObjectPointerVisitor {
vm_heap_(Dart::vm_isolate()->heap()),
delayed_weak_stack_(),
growth_policy_(PageSpace::kControlGrowth),
+ bytes_promoted_(0),
visiting_old_pointers_(false),
in_scavenge_pointer_(false) {}
@@ -108,6 +109,8 @@ class ScavengerVisitor : public ObjectPointerVisitor {
}
}
+ intptr_t bytes_promoted() { return bytes_promoted_; }
siva 2013/01/07 22:35:33 intptr_t bytes_promoted() const { ... }
cshapiro 2013/01/07 23:16:22 I thought about doing this during my original chan
+
private:
void UpdateStoreBuffer(RawObject** p, RawObject* obj) {
uword ptr = reinterpret_cast<uword>(p);
@@ -184,6 +187,7 @@ class ScavengerVisitor : public ObjectPointerVisitor {
// If promotion succeeded then we need to remember it so that it can
// be traversed later.
scavenger_->PushToPromotedStack(new_addr);
+ bytes_promoted_ += size;
if (HeapTrace::is_enabled()) {
heap_->trace()->TracePromotion(raw_addr, new_addr);
}
@@ -196,6 +200,7 @@ class ScavengerVisitor : public ObjectPointerVisitor {
new_addr = heap_->TryAllocate(size, Heap::kOld, growth_policy_);
if (new_addr != 0) {
scavenger_->PushToPromotedStack(new_addr);
+ bytes_promoted_ += size;
if (HeapTrace::is_enabled()) {
heap_->trace()->TracePromotion(raw_addr, new_addr);
}
@@ -242,6 +247,7 @@ class ScavengerVisitor : public ObjectPointerVisitor {
DelaySet delay_set_;
GrowableArray<RawObject*> delayed_weak_stack_;
PageSpace::GrowthPolicy growth_policy_;
+ intptr_t bytes_promoted_;
siva 2013/01/07 22:33:45 Currently this variable is not being used anywhere
cshapiro 2013/01/07 23:16:22 I will add a TODO comment about this value's relat
bool visiting_old_pointers_;
bool in_scavenge_pointer_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698