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

Issue 5987005: Refactor MemoryAllocator to allow big normal pages (Closed)

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

Description

Refactor MemoryAllocator to allow big normal pages (currently 1mb). Committed: http://code.google.com/p/v8/source/detail?r=6116

Patch Set 1 #

Total comments: 19

Patch Set 2 : fix Erik comments #

Patch Set 3 : revert change in tickprocessor.js #

Patch Set 4 : revert change in tickprocessor.js #

Patch Set 5 : remove rogue printf #

Unified diffs Side-by-side diffs Delta from patch set Stats (+722 lines, -1875 lines) Patch
M src/deoptimizer.h View 2 chunks +3 lines, -3 lines 0 comments Download
M src/deoptimizer.cc View 6 chunks +16 lines, -15 lines 0 comments Download
M src/frames.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/heap.h View 1 1 chunk +3 lines, -3 lines 0 comments Download
M src/heap.cc View 1 2 3 4 6 chunks +18 lines, -36 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 1 chunk +8 lines, -5 lines 0 comments Download
M src/platform.h View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/platform-linux.cc View 2 chunks +45 lines, -12 lines 0 comments Download
M src/spaces.h View 1 35 chunks +222 lines, -467 lines 0 comments Download
M src/spaces.cc View 1 34 chunks +338 lines, -1106 lines 0 comments Download
M src/spaces-inl.h View 12 chunks +16 lines, -167 lines 0 comments Download
M src/utils.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/v8globals.h View 1 chunk +3 lines, -3 lines 0 comments Download
M test/cctest/test-alloc.cc View 1 2 chunks +8 lines, -6 lines 0 comments Download
M test/cctest/test-heap.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M test/cctest/test-mark-compact.cc View 1 chunk +5 lines, -3 lines 0 comments Download
M test/cctest/test-spaces.cc View 1 6 chunks +23 lines, -46 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Vyacheslav Egorov (Chromium)
10 years ago (2010-12-21 18:23:59 UTC) #1
Vyacheslav Egorov (Chromium)
Erik, This is mostly request for comments. Please start from changes in spaces.h/spaces.cc. There are ...
10 years ago (2010-12-21 18:27:37 UTC) #2
Erik Corry
spaces.h and spaces.cc lgtm http://codereview.chromium.org/5987005/diff/1/src/spaces.cc File src/spaces.cc (right): http://codereview.chromium.org/5987005/diff/1/src/spaces.cc#newcode326 src/spaces.cc:326: void* MemoryAllocator::ReserveAlignedMemory(const size_t requested, Shouldn't ...
10 years ago (2010-12-22 13:48:27 UTC) #3
Vyacheslav Egorov (Chromium)
10 years ago (2010-12-22 19:55:07 UTC) #4
Erik,

I addressed your comments.

If there be no new ones I will land this CL tomorrow as we agreed.

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

http://codereview.chromium.org/5987005/diff/1/src/spaces.cc#newcode326
src/spaces.cc:326: void* MemoryAllocator::ReserveAlignedMemory(const size_t
requested,
On 2010/12/22 13:48:27, Erik Corry wrote:
> Shouldn't this return an Address?

Done. I eradicated void* usages.

http://codereview.chromium.org/5987005/diff/1/src/spaces.cc#newcode862
src/spaces.cc:862: ASSERT(IsAddressAligned(chunk_base_,
2*maximum_semispace_capacity, 0));
On 2010/12/22 13:48:27, Erik Corry wrote:
> spaces around '*'

Done.

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

http://codereview.chromium.org/5987005/diff/1/src/spaces.h#newcode116
src/spaces.h:116: // MemoryChunk represents memory region owned by a specific
space.
On 2010/12/22 13:48:27, Erik Corry wrote:
> represents memory -> represents a memory

Done.

http://codereview.chromium.org/5987005/diff/1/src/spaces.h#newcode130
src/spaces.h:130: MemoryChunk* next_chunk() const { return next_; }
On 2010/12/22 13:48:27, Erik Corry wrote:
> For getters the function is normally called the same as the variable, so the
> variable should be called next_chunk_ or the getter should be called next()

Done.

http://codereview.chromium.org/5987005/diff/1/src/spaces.h#newcode154
src/spaces.h:154: return flags_ & (1 << flag);
On 2010/12/22 13:48:27, Erik Corry wrote:
> Implicit conversions from int to bool are not allowed, so you need to add "!=
0"
> here.

Done.

http://codereview.chromium.org/5987005/diff/1/src/spaces.h#newcode234
src/spaces.h:234: return static_cast<Page*>(next_chunk());
On 2010/12/22 13:48:27, Erik Corry wrote:
> Should we assert that the next chunk is a page?

I added an assert to check that pages have the same owner.

There is currently no page type flag stored in the page itself.

Maybe we should consider eradicating LargePage type completely.

http://codereview.chromium.org/5987005/diff/1/src/spaces.h#newcode270
src/spaces.h:270: // only after PagedSpace::PrepareForMarkCompact was called.
On 2010/12/22 13:48:27, Erik Corry wrote:
> Should the comment go away?

Done.

http://codereview.chromium.org/5987005/diff/1/src/spaces.h#newcode658
src/spaces.h:658: static size_t capacity_;
On 2010/12/22 13:48:27, Erik Corry wrote:
> I don't like unsigned types much, so I tend to prefer intptr_t to size-t

I like signed types :-)

But the reason I changed these declaration is different: 
interface to MemoryAllocator (and platform interface) was initially based on
size_t so casts inside were a bit weird.

Powered by Google App Engine
This is Rietveld 408576698