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

Unified Diff: runtime/vm/scavenger.cc

Issue 27604002: - Add more data collection to the scavenger. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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/scavenger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
===================================================================
--- runtime/vm/scavenger.cc (revision 28687)
+++ runtime/vm/scavenger.cc (working copy)
@@ -73,6 +73,8 @@
scavenger_(scavenger),
heap_(scavenger->heap_),
vm_heap_(Dart::vm_isolate()->heap()),
+ visited_count_(0),
+ handled_count_(0),
delayed_weak_stack_(),
growth_policy_(PageSpace::kControlGrowth),
bytes_promoted_(0),
@@ -113,6 +115,8 @@
}
}
+ intptr_t visited_count() const { return visited_count_; }
+ intptr_t handled_count() const { return handled_count_; }
intptr_t bytes_promoted() const { return bytes_promoted_; }
private:
@@ -137,6 +141,7 @@
BoolScope bs(&in_scavenge_pointer_, true);
#endif
+ visited_count_++;
RawObject* raw_obj = *p;
// Fast exit if the raw object is a Smi or an old object.
@@ -153,6 +158,7 @@
return;
}
+ handled_count_++;
// Read the header word of the object and determine if the object has
// already been copied.
uword header = *reinterpret_cast<uword*>(raw_addr);
@@ -237,6 +243,8 @@
Scavenger* scavenger_;
Heap* heap_;
Heap* vm_heap_;
+ intptr_t visited_count_;
+ intptr_t handled_count_;
typedef std::multimap<RawObject*, RawWeakProperty*> DelaySet;
DelaySet delay_set_;
GrowableArray<RawObject*> delayed_weak_stack_;
@@ -379,16 +387,16 @@
void Scavenger::IterateStoreBuffers(Isolate* isolate,
ScavengerVisitor* visitor) {
StoreBuffer* buffer = isolate->store_buffer();
- heap_->RecordData(kStoreBufferBlockEntries, buffer->Count());
+ heap_->RecordData(kStoreBufferEntries, buffer->Count());
// Iterating through the store buffers.
// Grab the deduplication sets out of the store buffer.
StoreBufferBlock* pending = isolate->store_buffer()->Blocks();
- intptr_t entries = 0;
+ intptr_t visited_count_before = visitor->visited_count();
+ intptr_t handled_count_before = visitor->handled_count();
while (pending != NULL) {
StoreBufferBlock* next = pending->next();
intptr_t count = pending->Count();
- entries += count;
for (intptr_t i = 0; i < count; i++) {
RawObject* raw_object = pending->At(i);
ASSERT(raw_object->IsRemembered());
@@ -399,7 +407,10 @@
delete pending;
pending = next;
}
- heap_->RecordData(kStoreBufferEntries, entries);
+ heap_->RecordData(kStoreBufferVisited,
+ visitor->visited_count() - visited_count_before);
+ heap_->RecordData(kStoreBufferPointers,
+ visitor->handled_count() - handled_count_before);
// Done iterating through old objects remembered in the store buffers.
visitor->VisitingOldObject(NULL);
}
@@ -428,6 +439,7 @@
IterateStoreBuffers(isolate, visitor);
IterateObjectIdTable(isolate, visitor);
int64_t end = OS::GetCurrentTimeMicros();
+ heap_->RecordData(kToKBAfterStoreBuffer, (in_use() + (KB >> 1)) >> KBLog2);
heap_->RecordTime(kVisitIsolateRoots, middle - start);
heap_->RecordTime(kIterateStoreBuffers, end - middle);
}
« no previous file with comments | « runtime/vm/scavenger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698