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

Issue 6745033: On store buffer overflow we mark individidual pages for... (Closed)

Created:
9 years, 9 months ago by Erik Corry
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

On store buffer overflow we mark individidual pages for scanning instead of scanning all of old space. Committed: http://code.google.com/p/v8/source/detail?r=7395

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 26
Unified diffs Side-by-side diffs Delta from patch set Stats (+664 lines, -297 lines) Patch
M src/heap.h View 1 8 chunks +27 lines, -14 lines 2 comments Download
M src/heap.cc View 1 2 12 chunks +125 lines, -67 lines 2 comments Download
M src/heap-inl.h View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
M src/incremental-marking.h View 1 2 2 chunks +4 lines, -1 line 0 comments Download
M src/incremental-marking.cc View 1 2 3 chunks +8 lines, -1 line 0 comments Download
M src/list.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/log.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/mark-compact.cc View 1 2 4 chunks +5 lines, -6 lines 2 comments Download
M src/objects.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/objects-inl.h View 1 1 chunk +2 lines, -1 line 2 comments Download
M src/runtime.cc View 1 2 14 chunks +92 lines, -54 lines 0 comments Download
M src/spaces.h View 1 2 8 chunks +101 lines, -11 lines 10 comments Download
M src/spaces.cc View 1 6 chunks +18 lines, -6 lines 0 comments Download
M src/spaces-inl.h View 2 chunks +34 lines, -8 lines 0 comments Download
M src/store-buffer.h View 1 2 7 chunks +35 lines, -18 lines 0 comments Download
M src/store-buffer.cc View 1 2 9 chunks +174 lines, -84 lines 8 comments Download
M src/store-buffer-inl.h View 1 2 3 chunks +13 lines, -24 lines 0 comments Download
M src/v8globals.h View 2 chunks +12 lines, -0 lines 0 comments Download
M test/cctest/test-mark-compact.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Erik Corry
9 years, 9 months ago (2011-03-28 13:30:23 UTC) #1
Vyacheslav Egorov (Chromium)
LGTM approach with callback looks a bit overcomplicated though. http://codereview.chromium.org/6745033/diff/19002/src/heap.cc File src/heap.cc (right): http://codereview.chromium.org/6745033/diff/19002/src/heap.cc#newcode492 src/heap.cc:492: ...
9 years, 9 months ago (2011-03-28 15:13:19 UTC) #2
Erik Corry
9 years, 9 months ago (2011-03-28 15:56:07 UTC) #3
http://codereview.chromium.org/6745033/diff/19002/src/heap.cc
File src/heap.cc (right):

http://codereview.chromium.org/6745033/diff/19002/src/heap.cc#newcode492
src/heap.cc:492: IncrementalMarking::set_should_hurry(false);
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> I think nicer place to clean the flag is in the IncrementalMarking::Finalize()

Done and made it private.

http://codereview.chromium.org/6745033/diff/19002/src/heap.h
File src/heap.h (right):

http://codereview.chromium.org/6745033/diff/19002/src/heap.h#newcode244
src/heap.h:244: // The fullness of the store buffer when we started to scan the
current page.
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> I can't grok the comment.

Rewritten.

http://codereview.chromium.org/6745033/diff/19002/src/mark-compact.cc
File src/mark-compact.cc (right):

http://codereview.chromium.org/6745033/diff/19002/src/mark-compact.cc#newcode...
src/mark-compact.cc:1729:
StoreBuffer::EnterDirectlyIntoStoreBuffer(reinterpret_cast<Address>(p));
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> This visitor is used to visit new space objects.
> 
> Their slots should not be entered into store-buffer.

Good catch!

http://codereview.chromium.org/6745033/diff/19002/src/objects-inl.h
File src/objects-inl.h (right):

http://codereview.chromium.org/6745033/diff/19002/src/objects-inl.h#newcode834
src/objects-inl.h:834: if (Heap::InNewSpace(value)) \
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> curly brackets around if's body.

Done.

http://codereview.chromium.org/6745033/diff/19002/src/spaces.h
File src/spaces.h (right):

http://codereview.chromium.org/6745033/diff/19002/src/spaces.h#newcode334
src/spaces.h:334: owner_ = reinterpret_cast<Address>(space) + kFailureTag;
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> add assertion that checks that space was properly aligned.

Done.

http://codereview.chromium.org/6745033/diff/19002/src/spaces.h#newcode449
src/spaces.h:449: // The identity of the owning space.  This is tagged as a heap
pointer, but
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> Update comment. Now this is tagged as a failure and failures can reside in
> objects.

Done.

http://codereview.chromium.org/6745033/diff/19002/src/spaces.h#newcode453
src/spaces.h:453: // This flag indicates that the page is not being tracked by
the store buffer.
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> Why are we using bool instead of built-in flags?

Because my next step will be to read it from generated code and for that the
code will be more compact if it is a bool rather than a bit we have to mask.

http://codereview.chromium.org/6745033/diff/19002/src/spaces.h#newcode459
src/spaces.h:459: int store_buffer_counter_;
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> You added 2 fields but kHeaderSize was increased only by 1 kPointerSize.

There is a static assert that checks that the size is sufficient. Apparently it
was too big before.

http://codereview.chromium.org/6745033/diff/19002/src/spaces.h#newcode2051
src/spaces.h:2051: // FALL THROUGH!
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> this comment does not look like something we usually write.

lowercaseified.

http://codereview.chromium.org/6745033/diff/19002/src/store-buffer.cc
File src/store-buffer.cc (right):

http://codereview.chromium.org/6745033/diff/19002/src/store-buffer.cc#newcode171
src/store-buffer.cc:171: ExemptPopularPages(97, ((Page::kPageSize /
kPointerSize) / 97) / 8);
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> this looks like a repeatable pattern.
> loop with array of prime numbers?

Done.

http://codereview.chromium.org/6745033/diff/19002/src/store-buffer.cc#newcode231
src/store-buffer.cc:231: containing_chunk =
MemoryChunk::FromAnyPointerAddress(addr);
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> This code can be pretty slow on certain patterns.

Yes.

http://codereview.chromium.org/6745033/diff/19002/src/store-buffer.cc#newcode340
src/store-buffer.cc:340: void StoreBuffer::Verify() {
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> I think we should have a way to verify store-buffer or we might have some
> troubles debugging strange crashes.

I will consider this for another change.

http://codereview.chromium.org/6745033/diff/19002/src/store-buffer.cc#newcode397
src/store-buffer.cc:397: if (array->IsFixedArray()) {
On 2011/03/28 15:13:19, Vyacheslav Egorov wrote:
> maybe you should assert that array is actually a fixed array, cause no other
lo
> chunk should be have scan_on_scavenge().

Done.

Powered by Google App Engine
This is Rietveld 408576698