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

Unified Diff: src/heap/gc-tracer.cc

Issue 710603003: Perform context disposal garbage collections only if contexts disposals happen at a high rate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | « src/heap/gc-tracer.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-tracer.cc
diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc
index 8a40b53a62cedf5cdc80b7c8fa9d5a3f99562667..9d4a991c4121f2f9a33e8b62810546216c30d301 100644
--- a/src/heap/gc-tracer.cc
+++ b/src/heap/gc-tracer.cc
@@ -26,6 +26,11 @@ GCTracer::AllocationEvent::AllocationEvent(double duration,
}
+GCTracer::ContextDisposalEvent::ContextDisposalEvent(double time) {
+ time_ = time;
+}
+
+
GCTracer::Event::Event(Type type, const char* gc_reason,
const char* collector_reason)
: type(type),
@@ -207,6 +212,11 @@ void GCTracer::AddNewSpaceAllocationTime(double duration,
}
+void GCTracer::AddContextDisposalTime(double time) {
+ context_disposal_events_.push_front(ContextDisposalEvent(time));
+}
+
+
void GCTracer::AddIncrementalMarkingStep(double duration, intptr_t bytes) {
cumulative_incremental_marking_steps_++;
cumulative_incremental_marking_bytes_ += bytes;
@@ -319,6 +329,7 @@ void GCTracer::PrintNVP() const {
PrintF("semi_space_copy_rate=%.1f%% ", heap_->semi_space_copied_rate_);
PrintF("new_space_allocation_throughput=%" V8_PTR_PREFIX "d ",
NewSpaceAllocationThroughputInBytesPerMillisecond());
+ PrintF("context_disposal_rate=%.1f ", ContextDisposalRateInMilliseconds());
if (current_.type == Event::SCAVENGER) {
PrintF("steps_count=%d ", current_.incremental_marking_steps);
@@ -476,5 +487,21 @@ intptr_t GCTracer::NewSpaceAllocationThroughputInBytesPerMillisecond() const {
return static_cast<intptr_t>(bytes / durations);
}
+
+
+double GCTracer::ContextDisposalRateInMilliseconds() const {
+ if (context_disposal_events_.size() == 0) return 0.0;
+
+ double begin = context_disposal_events_.begin()->time_;
+ double end = 0.0;
+ ContextDisposalEventBuffer::const_iterator iter =
+ context_disposal_events_.begin();
+ while (iter != context_disposal_events_.end()) {
+ end = iter->time_;
+ ++iter;
+ }
+
+ return (begin - end) / context_disposal_events_.size();
+}
}
} // namespace v8::internal
« no previous file with comments | « src/heap/gc-tracer.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698