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

Issue 5826004: Add a write buffer, aligned so that a single bit tells us whether it has... (Closed)

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

Description

Add a write buffer, aligned so that a single bit tells us whether it has overflowed. Not yet used.

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -6 lines) Patch
M src/SConscript View 1 chunk +1 line, -0 lines 0 comments Download
M src/allocation.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/assembler.h View 1 chunk +3 lines, -0 lines 2 comments Download
M src/assembler.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M src/checks.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/globals.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/heap-inl.h View 1 chunk +1 line, -1 line 0 comments Download
M src/heap-profiler.h View 1 chunk +1 line, -1 line 0 comments Download
M src/heap-profiler.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/platform.h View 2 chunks +4 lines, -0 lines 0 comments Download
M src/spaces.h View 1 chunk +1 line, -1 line 0 comments Download
M src/spaces.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/spaces-inl.h View 1 chunk +1 line, -1 line 0 comments Download
M src/v8.cc View 3 chunks +5 lines, -0 lines 0 comments Download
A src/write-buffer.h View 1 chunk +59 lines, -0 lines 4 comments Download
A src/write-buffer.cc View 1 chunk +61 lines, -0 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
Erik Corry
10 years ago (2010-12-14 21:42:07 UTC) #1
Vyacheslav Egorov (Chromium)
wrong branch. LGTM (though I am bit confused by some seemingly unrelated changes here and ...
10 years ago (2010-12-14 22:40:14 UTC) #2
Erik Corry
10 years ago (2010-12-15 08:00:13 UTC) #3
I will commit to the correct branch.

http://codereview.chromium.org/5826004/diff/1/src/assembler.h
File src/assembler.h (right):

http://codereview.chromium.org/5826004/diff/1/src/assembler.h#newcode537
src/assembler.h:537: // Write barrier.
On 2010/12/14 22:40:14, Vyacheslav Egorov wrote:
> barrier -> buffer.

The write barrier is implemented using a write buffer.  It would be redundant to
have 'write buffer' in the comment would be redundant.

http://codereview.chromium.org/5826004/diff/1/src/write-buffer.cc
File src/write-buffer.cc (right):

http://codereview.chromium.org/5826004/diff/1/src/write-buffer.cc#newcode39
src/write-buffer.cc:39: virtual_memory_ = new VirtualMemory(kWriteBufferSize *
3);
On 2010/12/14 22:40:14, Vyacheslav Egorov wrote:
> This allocation looks OK for single buffer but I am not sure that it is OK for
> multiple buffers (if we decide to have many of them).

I'll burn that bridge when I come to it.

> 
> On Windows which has allocation granularity 64k this is going to waste 98k of
> address space.

I think that 0.0025% of the address space is worth spending on my awsum idea. 
The new space will use 160 times as much.

> Even on Linux it might be beneficial to return unused parts of this memory
back
> to OS.



> I see no obvious benefit for single bit vs. several bits on x86 (though
benefit
> is obvious on ARM): mask = (kWriteBufferOverflowBit - 1), alignent =
> kWriteBufferOverflowBit.

It's definitely more compact on ARM and I like that.

http://codereview.chromium.org/5826004/diff/1/src/write-buffer.h
File src/write-buffer.h (right):

http://codereview.chromium.org/5826004/diff/1/src/write-buffer.h#newcode39
src/write-buffer.h:39: class WriteBuffer : public AllStatic {
On 2010/12/14 22:40:14, Vyacheslav Egorov wrote:
> Consider adding a small comment about the role of this class.

Done.

http://codereview.chromium.org/5826004/diff/1/src/write-buffer.h#newcode47
src/write-buffer.h:47: static const int kWriteBufferOverflowBit = 1 << 15;
On 2010/12/14 22:40:14, Vyacheslav Egorov wrote:
> 15 and 32 are connected.
> 
> consider expressing this connection through introduction of a constant

Done.

Powered by Google App Engine
This is Rietveld 408576698