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

Issue 504026: Extend the maximum size map space... (Closed)

Created:
11 years ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Extend the maximum size map space On 32-bit the maps are now aligned on a 32-byte boundary in order to encode more maps during compacting GC. The actual size of a map on 32-bit is 28 bytes making this change waste 4 bytes per map. On 64-bit the encoding for compacting GC is now using more than 32-bits and the maps here are still pointer size aligned. The actual size of a map on 64-bit is 48 bytes and this change does not intruduce any waste. My choice of 16 bits for kMapPageIndexBits for 64-bit should give the same maximum number of pages (8K) for map space. As maps on 64-bit are larger than on 32-bit the total number of maps on 64-bit will be smaller than on 32-bit. We could consider raising this to 17 or 18. I moved the kPageSizeBits to globals.h as the calculation of the encoding really depended on this. There are still an #ifdef/#endif in objects.h and this constant could be moved to globaks.h as well, but I kept it together with the related constants. All the tests run in debug mode with additional options --gc-global --always-compact as well (except for a few tests on which also fails before this change when run with --gc-global --always-compact). BUG=http://code.google.com/p/v8/issues/detail?id=524 BUG=http://crbug.com/29428 TEST=test/mjsunit/regress/regress-524.js Committed: http://code.google.com/p/v8/source/detail?r=3481

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 14

Patch Set 3 : '' #

Total comments: 10

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -47 lines) Patch
M src/globals.h View 1 2 3 chunks +17 lines, -0 lines 0 comments Download
M src/heap.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/heap.cc View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M src/heap-inl.h View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M src/mark-compact.cc View 1 chunk +2 lines, -5 lines 0 comments Download
M src/objects.h View 1 2 3 4 chunks +22 lines, -16 lines 0 comments Download
M src/objects-inl.h View 1 2 2 chunks +5 lines, -5 lines 0 comments Download
M src/serialize.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M src/spaces.h View 1 2 3 4 chunks +12 lines, -15 lines 0 comments Download
M src/spaces.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M test/mjsunit/mjsunit.status View 1 chunk +2 lines, -0 lines 0 comments Download
A test/mjsunit/regress/regress-524.js View 1 1 chunk +32 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Søren Thygesen Gjesse
11 years ago (2009-12-16 14:00:09 UTC) #1
antonm
http://codereview.chromium.org/504026/diff/3001/3002 File src/heap.cc (right): http://codereview.chromium.org/504026/diff/3001/3002#newcode1146 src/heap.cc:1146: // If the map bject is aligned fill the ...
11 years ago (2009-12-16 14:08:43 UTC) #2
Mads Ager (chromium)
LGTM http://codereview.chromium.org/504026/diff/3001/3010 File src/globals.h (right): http://codereview.chromium.org/504026/diff/3001/3010#newcode186 src/globals.h:186: static const int kPageSizeBits = 13; Get rid ...
11 years ago (2009-12-16 14:19:16 UTC) #3
Søren Thygesen Gjesse
http://codereview.chromium.org/504026/diff/3001/3010 File src/globals.h (right): http://codereview.chromium.org/504026/diff/3001/3010#newcode186 src/globals.h:186: static const int kPageSizeBits = 13; On 2009/12/16 14:19:16, ...
11 years ago (2009-12-16 15:10:30 UTC) #4
antonm
LGTM just curious: do you know if it fixes the Chromium issue w/ dashboard?
11 years ago (2009-12-16 15:18:22 UTC) #5
antonm
http://codereview.chromium.org/504026/diff/6001/6004 File src/spaces.h (left): http://codereview.chromium.org/504026/diff/6001/6004#oldcode1744 src/spaces.h:1744: static const int kMaxMapPageIndex = (1 << MapWord::kMapPageIndexBits) - ...
11 years ago (2009-12-16 16:26:30 UTC) #6
Søren Thygesen Gjesse
http://codereview.chromium.org/504026/diff/6001/6004 File src/spaces.h (left): http://codereview.chromium.org/504026/diff/6001/6004#oldcode1744 src/spaces.h:1744: static const int kMaxMapPageIndex = (1 << MapWord::kMapPageIndexBits) - ...
11 years ago (2009-12-16 22:19:41 UTC) #7
antonm
http://codereview.chromium.org/504026/diff/6001/6005 File src/objects.h (right): http://codereview.chromium.org/504026/diff/6001/6005#newcode919 src/objects.h:919: #ifndef V8_HOST_ARCH_64_BIT just an idea: maybe instead of STATIC_CHECK ...
11 years ago (2009-12-17 06:49:45 UTC) #8
Søren Thygesen Gjesse
11 years ago (2009-12-17 08:39:37 UTC) #9
Anton, thank you for the thorough review of this CL.

http://codereview.chromium.org/504026/diff/6001/6005
File src/objects.h (right):

http://codereview.chromium.org/504026/diff/6001/6005#newcode919
src/objects.h:919: #ifndef V8_HOST_ARCH_64_BIT
On 2009/12/17 06:49:46, antonm wrote:
> just an idea: maybe instead of STATIC_CHECK declare kMapPageIndexBits as 32 -
> (kForwardingOffsetBits + kMapPageOffsetBits)?
> 
> Up to you.

Good point, now kMapPageIndexBits is only set to a fixed value on 64-bit and its
maximum on 32-bit.

http://codereview.chromium.org/504026/diff/6001/6005#newcode925
src/objects.h:925: // Bit masks covering the different parts the encodeding.
On 2009/12/17 06:49:46, antonm wrote:
> nit: encod<de>ing

Done.

http://codereview.chromium.org/504026/diff/6001/6004
File src/spaces.h (left):

http://codereview.chromium.org/504026/diff/6001/6004#oldcode1744
src/spaces.h:1744: static const int kMaxMapPageIndex = (1 <<
MapWord::kMapPageIndexBits) - 1;
On 2009/12/17 06:49:46, antonm wrote:
> On 2009/12/16 22:19:41, Søren Gjesse wrote:
> > On 2009/12/16 16:26:30, antonm wrote:
> > > BTW, do I miss something or this constant should be increased to be
> something
> > > like (1 << (MapWord::kMapPageIndexBits + kMapAlignmentBits -
> > > kObjectAlignmentBits))?
> > > 
> > > If yes, could you merge them to get rid of duplication?
> > 
> > This is correct, as we need one entry for each possible page of map space.
> What
> > is wrong however is the calculation of kMaxMapSpaceSize which should be
> > 
> >   static const int kMaxMapSpaceSize =
> >       (1 << (MapWord::kMapPageIndexBits)) * Page::kPageSize;
> > 
> > Thanks for spotting this inconsistency.
> 
> You're right. 
> 
> The fact that Chromium didn't crash for dashboard makes me somewhat uneasy as
> map space might have grown to the size when pointers are not encodable (but
> probably this point wasn't reached).

It sure means that no test fails, which is not so good. I tried running the
regress-524.js allocating even more with this bug, and it allocated > 10000
pages in map space before running out of memory. With the correct max-size of
map space OOM happens with 8K pages in map space.

http://codereview.chromium.org/504026/diff/6001/6004
File src/spaces.h (right):

http://codereview.chromium.org/504026/diff/6001/6004#newcode74
src/spaces.h:74: #define ASSERT_MAP_ALIGNED(address)                \
On 2009/12/17 06:49:46, antonm wrote:
> nit: maybe align \ to \ above?

Moved all \'s to position 79.

Powered by Google App Engine
This is Rietveld 408576698