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

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

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-idle-time-handler.cc ('k') | src/heap/gc-tracer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-tracer.h
diff --git a/src/heap/gc-tracer.h b/src/heap/gc-tracer.h
index 4e70f0741c5aaf0e05c9a7297bbbf972e6ce4527..2655f1f48cb1e5c5af39389b4d82859c6c8ef6ee 100644
--- a/src/heap/gc-tracer.h
+++ b/src/heap/gc-tracer.h
@@ -145,6 +145,19 @@ class GCTracer {
intptr_t allocation_in_bytes_;
};
+
+ class ContextDisposalEvent {
+ public:
+ // Default constructor leaves the event uninitialized.
+ ContextDisposalEvent() {}
+
+ explicit ContextDisposalEvent(double time);
+
+ // Time when context disposal event happened.
+ double time_;
+ };
+
+
class Event {
public:
enum Type { SCAVENGER = 0, MARK_COMPACTOR = 1, START = 2 };
@@ -241,6 +254,9 @@ class GCTracer {
typedef RingBuffer<AllocationEvent, kRingBufferMaxSize> AllocationEventBuffer;
+ typedef RingBuffer<ContextDisposalEvent, kRingBufferMaxSize>
+ ContextDisposalEventBuffer;
+
explicit GCTracer(Heap* heap);
// Start collecting data.
@@ -253,6 +269,8 @@ class GCTracer {
// Log an allocation throughput event.
void AddNewSpaceAllocationTime(double duration, intptr_t allocation_in_bytes);
+ void AddContextDisposalTime(double time);
+
// Log an incremental marking step.
void AddIncrementalMarkingStep(double duration, intptr_t bytes);
@@ -322,6 +340,12 @@ class GCTracer {
// Returns 0 if no events have been recorded.
intptr_t NewSpaceAllocationThroughputInBytesPerMillisecond() const;
+ // Computes the context disposal rate in milliseconds. It takes the time
+ // frame of the first and last context disposal event and devides it by the
+ // number of recorded events.
+ // Returns 0 if no events have been recorded.
+ double ContextDisposalRateInMilliseconds() const;
+
private:
// Print one detailed trace line in name=value format.
// TODO(ernstm): Move to Heap.
@@ -359,6 +383,8 @@ class GCTracer {
// RingBuffer for allocation events.
AllocationEventBuffer allocation_events_;
+ ContextDisposalEventBuffer context_disposal_events_;
+
// Cumulative number of incremental marking steps since creation of tracer.
int cumulative_incremental_marking_steps_;
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | src/heap/gc-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698