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

Issue 10459047: Clean up d8 ArrayBuffer implementation and fix bug in readbuffer: (Closed)

Created:
8 years, 6 months ago by rossberg
Modified:
8 years, 6 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

Clean up d8 ArrayBuffer implementation and fix bug in readbuffer: - Separate CreateExternalArrayBuffer function. - Properly create buffers for arrays constructed with size argument only. - Finalization of data array is tied to buffer object exclusively. - Get rid of hidden buffer reference in array objects and size header in data. - Use 'new' instead of 'malloc' in readbuffer. - Test cases for additional array and buffer properties. R=mstarzinger@chromium.org BUG= TEST= Committed: https://code.google.com/p/v8/source/detail?r=11698

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed Michael's comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+170 lines, -103 lines) Patch
M src/d8.h View 1 chunk +3 lines, -1 line 0 comments Download
M src/d8.cc View 1 4 chunks +87 lines, -102 lines 0 comments Download
M test/mjsunit/external-array.js View 3 chunks +80 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
rossberg
8 years, 6 months ago (2012-05-31 12:01:36 UTC) #1
Michael Starzinger
LGTM (if comments are addressed). I like that change. https://chromiumcodereview.appspot.com/10459047/diff/1/src/d8.cc File src/d8.cc (right): https://chromiumcodereview.appspot.com/10459047/diff/1/src/d8.cc#newcode1029 src/d8.cc:1029: ...
8 years, 6 months ago (2012-06-01 09:43:28 UTC) #2
rossberg
8 years, 6 months ago (2012-06-01 11:42:35 UTC) #3
https://chromiumcodereview.appspot.com/10459047/diff/1/src/d8.cc
File src/d8.cc (right):

https://chromiumcodereview.appspot.com/10459047/diff/1/src/d8.cc#newcode1029
src/d8.cc:1029: void* data = ReadChars(*filename, &length);
On 2012/06/01 09:43:28, Michael Starzinger wrote:
> Why this change? I would prefer it to stay "char*" if possible.

Actually, changed it to uint8_t, which is more adequate.

https://chromiumcodereview.appspot.com/10459047/diff/1/src/d8.cc#newcode1037
src/d8.cc:1037: persistent_buffer.MarkIndependent();
On 2012/06/01 09:43:28, Michael Starzinger wrote:
> I think we are missing a positive adjustment of the external memory amount
> statistics here. The following line should do the trick.
> 
> V8::AdjustAmountOfExternalAllocatedMemory(length);

Done.

Powered by Google App Engine
This is Rietveld 408576698