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

Issue 1683001: Put empty pages discovered during sweeping to the end of the list of pages... (Closed)

Created:
10 years, 8 months ago by Vyacheslav Egorov (Chromium)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Put empty pages discovered during sweeping to the end of the list of pages instead of adding them to the free list. Committed: http://code.google.com/p/v8/source/detail?r=4475

Patch Set 1 #

Total comments: 26

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+461 lines, -57 lines) Patch
M src/mark-compact.h View 2 chunks +24 lines, -6 lines 0 comments Download
M src/mark-compact.cc View 1 6 chunks +125 lines, -26 lines 0 comments Download
M src/spaces.h View 1 14 chunks +84 lines, -15 lines 0 comments Download
M src/spaces.cc View 1 10 chunks +189 lines, -5 lines 0 comments Download
M src/spaces-inl.h View 1 chunk +34 lines, -0 lines 0 comments Download
M test/cctest/test-heap.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M test/cctest/test-spaces.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Vyacheslav Egorov (Chromium)
Kevin do you have enough time in your freelist to take a look? // It ...
10 years, 8 months ago (2010-04-20 15:56:35 UTC) #1
Mads Ager (chromium)
LGTM with these comments addressed. http://codereview.chromium.org/1683001/diff/1/8 File src/mark-compact.cc (right): http://codereview.chromium.org/1683001/diff/1/8#newcode1066 src/mark-compact.cc:1066: p->ObjectAreaStart(), I believe the ...
10 years, 8 months ago (2010-04-22 13:19:28 UTC) #2
Vyacheslav Egorov (Chromium)
10 years, 8 months ago (2010-04-22 14:27:12 UTC) #3
Thanks for the review Mads! 

I fixed glitches and I am going to commit this change.

http://codereview.chromium.org/1683001/diff/1/8
File src/mark-compact.cc (right):

http://codereview.chromium.org/1683001/diff/1/8#newcode1066
src/mark-compact.cc:1066: p->ObjectAreaStart(),
On 2010/04/22 13:19:29, Mads Ager wrote:
> I believe the indentation of these arguments were correct before. When all
> arguments are on a new line, they should have a four space indent compared to
> the method name.
> 
> http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Function_Calls

Done. It seems there is a bug/inconsistency in the emacs indenter. Apparently it
thinks that ProcessNonLive is function we are calling.

http://codereview.chromium.org/1683001/diff/1/8#newcode1289
src/mark-compact.cc:1289: // of pages without live objects and free them
(instead of putting it to free
On 2010/04/22 13:19:29, Mads Ager wrote:
> it to -> them on the?

Done.

http://codereview.chromium.org/1683001/diff/1/8#newcode1346
src/mark-compact.cc:1346: int size_in_bytes =
static_cast<int>(p->AllocationTop() - free_start);
On 2010/04/22 13:19:29, Mads Ager wrote:
> Isn't there a corner case here where size_in_bytes is incorrect? If the page
is
> empty because nothing is allocated (p->ObjectAreaStart() ==
p->AllocationTop())
> then free_start will be NULL at this point which will make size_in_bytes much
> bigger than the actual 0 bytes?

Indeed! Thanks for spotting this. This loop is awfully complicated as was
rewritten several times so I missed it.

http://codereview.chromium.org/1683001/diff/1/8#newcode1358
src/mark-compact.cc:1358: // We have to deallocate and put into freelist ending
area
On 2010/04/22 13:19:29, Mads Ager wrote:
> I think this comment could be a bit clearer. How about something like: 
> 
> If there is a free ending area on one of the previous pages we deallocate that
> area and put it on the free list?

Done.

http://codereview.chromium.org/1683001/diff/1/8#newcode1382
src/mark-compact.cc:1382: // to the beggining of first empty page.
On 2010/04/22 13:19:29, Mads Ager wrote:
> beggining -> beginning.

Done.

http://codereview.chromium.org/1683001/diff/1/8#newcode1395
src/mark-compact.cc:1395: if (first_empty_page == NULL) {
On 2010/04/22 13:19:29, Mads Ager wrote:
> Combine all of this into one ASSERT or use #ifdef DEBUG?

Done.

http://codereview.chromium.org/1683001/diff/1/6
File src/spaces.cc (right):

http://codereview.chromium.org/1683001/diff/1/6#newcode675
src/spaces.cc:675: if (prev->is_valid())
On 2010/04/22 13:19:29, Mads Ager wrote:
> Please use braces around the body of a multi-line if statement.

Done.

http://codereview.chromium.org/1683001/diff/1/6#newcode683
src/spaces.cc:683: if (p->WasInUseBeforeMC())
On 2010/04/22 13:19:29, Mads Ager wrote:
> Ditto.

Done.

http://codereview.chromium.org/1683001/diff/1/6#newcode691
src/spaces.cc:691: if (last_page->WasInUseBeforeMC())
On 2010/04/22 13:19:29, Mads Ager wrote:
> Ditto.

Done.

http://codereview.chromium.org/1683001/diff/1/6#newcode755
src/spaces.cc:755: pages_list_is_chunk_ordered_ = true;
On 2010/04/22 13:19:29, Mads Ager wrote:
> pages_list -> page_list

Done.

http://codereview.chromium.org/1683001/diff/1/5
File src/spaces.h (right):

http://codereview.chromium.org/1683001/diff/1/5#newcode283
src/spaces.h:283: intptr_t flags;
On 2010/04/22 13:19:29, Mads Ager wrote:
> Is this just a bit field?  If so, why use an intptr_t here instead of an int?

It's legacy. I used this field to link pages into auxiliary list.  
Removed.

http://codereview.chromium.org/1683001/diff/1/5#newcode433
src/spaces.h:433: // and p precedes q in C or p and q belong to the different
chunks and p is last
On 2010/04/22 13:19:29, Mads Ager wrote:
> the different chunks -> different chunks.
> p is last -> p is the last.

Done.

http://codereview.chromium.org/1683001/diff/1/5#newcode550
src/spaces.h:550: static void RelinkPagesListInChunkOrder(PagedSpace* space,
On 2010/04/22 13:19:29, Mads Ager wrote:
> PagesList -> PageList

Done.

Powered by Google App Engine
This is Rietveld 408576698