- fixed RingBuffer.
- added unit test for RingBuffer
- separate RingBuffer members for scavenge and mark_compactor
- Event::Type to distinguish ANCHOR events from real GC events.
- Clean-ups.



https://codereview.chromium.org/391413006/diff/20001/src/globals.h
File src/globals.h (right):

https://codereview.chromium.org/391413006/diff/20001/src/globals.h#newcode361
src/globals.h:361: enum GarbageCollector { SCAVENGER = 0, MARK_COMPACTOR
= 1};
On 2014/07/22 09:10:17, Hannes Payer wrote:
Why do you have to initialize it with =0, and =1?

Not needed any more, with the introduction of Event::Type.

https://codereview.chromium.org/391413006/diff/20001/src/heap.cc
File src/heap.cc (right):

https://codereview.chromium.org/391413006/diff/20001/src/heap.cc#newcode6022
src/heap.cc:6022: Event mark_compactor_dummy_event(MARK_COMPACTOR, NULL,
NULL);
On 2014/07/22 09:10:17, Hannes Payer wrote:
Hmm, I am not sure if the dummy elements may be problematic. What
about
calculating the average gc time of the events in a buffer. The dummy
element
would have an impact on that.

Good point. I've added a type to the Event that will allow us to filter
out the dummy events (now called ANCHOR). Not having them will
complicate a lot of the code, because we need stats at GCTracer
construction time to compute deltas for the first real GC event.

https://codereview.chromium.org/391413006/diff/20001/src/heap.h
File src/heap.h (right):

https://codereview.chromium.org/391413006/diff/20001/src/heap.h#newcode653
src/heap.h:653: struct Event {
On 2014/07/22 09:10:17, Hannes Payer wrote:
C++ style guide: Use a struct only for passive objects that carry
data;
everything else is a class.

Done.

https://codereview.chromium.org/391413006/diff/20001/src/heap.h#newcode749
src/heap.h:749: EventBuffer event_buffers_[2];
On 2014/07/22 09:10:17, Hannes Payer wrote:
Ah, now I see why you have to initialize the enum. Why don't we use
two
EventBuffer intances?
EventBuffer scavenber_buffer_;
EventBuffer mark_compact_buffer_;
Should actually result in more compact code. WDYT? However, I can live
with both
options.

I've chosen the array, because the Previous() method can be implemented
more compactly if the 'other' ring buffer can be selected by index.

https://codereview.chromium.org/391413006/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to