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

Issue 159263: - A prototype which allows to expose CanvasPixelArray functionality... (Closed)

Created:
11 years, 5 months ago by iposva
Modified:
9 years, 4 months ago
CC:
v8-dev
Visibility:
Public.

Description

- Expose CanvasPixelArray functionality directly in JavaScript indexed property accesses. - The IC stubs have not been updated to handle these directly, but at least we do not have to leave the VM to access bytes. Committed: http://code.google.com/p/v8/source/detail?r=2549

Patch Set 1 #

Total comments: 5

Patch Set 2 : '' #

Total comments: 52

Patch Set 3 : '' #

Total comments: 18

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1136 lines, -428 lines) Patch
M include/v8.h View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download
M src/api.cc View 1 2 3 2 chunks +20 lines, -1 line 0 comments Download
M src/arm/ic-arm.cc View 1 2 3 3 chunks +6 lines, -6 lines 0 comments Download
M src/factory.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 1 chunk +10 lines, -0 lines 0 comments Download
M src/globals.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/handles.cc View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M src/heap.h View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download
M src/heap.cc View 1 2 3 3 chunks +22 lines, -2 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/ia32/ic-ia32.cc View 1 2 3 8 chunks +65 lines, -21 lines 0 comments Download
M src/jsregexp.cc View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M src/objects.h View 1 2 3 8 chunks +51 lines, -3 lines 0 comments Download
M src/objects.cc View 1 2 3 28 chunks +567 lines, -317 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 6 chunks +68 lines, -22 lines 0 comments Download
M src/objects-inl.h View 1 2 3 6 chunks +76 lines, -3 lines 0 comments Download
M src/runtime.cc View 1 2 3 7 chunks +83 lines, -47 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 3 1 chunk +131 lines, -0 lines 0 comments Download
M test/cctest/test-heap.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
iposva
This is the current state of the CanvasPixelArray prototype. It is now wired all the ...
11 years, 5 months ago (2009-07-23 08:56:51 UTC) #1
Mads Ager (chromium)
This looks like the right approach to me. I'm unsure about the API side of ...
11 years, 5 months ago (2009-07-23 14:21:45 UTC) #2
iposva
http://codereview.chromium.org/159263/diff/1/7 File src/handles.cc (right): http://codereview.chromium.org/159263/diff/1/7#newcode348 Line 348: if (has_exception) return Handle<Object>(Failure::Exception()); On 2009/07/23 14:21:45, Mads ...
11 years, 5 months ago (2009-07-27 07:01:53 UTC) #3
Kasper Lund
It might be nice to have a runtime call for attaching a PixelArray to an ...
11 years, 5 months ago (2009-07-27 07:43:40 UTC) #4
iposva
Uploaded a new version, ready for the next round. -Ivan http://codereview.chromium.org/159263/diff/1012/1022 File src/api.h (right): http://codereview.chromium.org/159263/diff/1012/1022#newcode102 ...
11 years, 5 months ago (2009-07-28 03:28:12 UTC) #5
Kasper Lund
LGTM, with a few comments: http://codereview.chromium.org/159263/diff/55/58 File include/v8.h (right): http://codereview.chromium.org/159263/diff/55/58#newcode1172 Line 1172: void SetElementsToPixelData(uint8_t* data, ...
11 years, 5 months ago (2009-07-28 06:07:27 UTC) #6
iposva
11 years, 5 months ago (2009-07-28 08:22:26 UTC) #7
http://codereview.chromium.org/159263/diff/55/58
File include/v8.h (right):

http://codereview.chromium.org/159263/diff/55/58#newcode1172
Line 1172: void SetElementsToPixelData(uint8_t* data, int length);
On 2009/07/28 06:07:27, Kasper Lund wrote:
> I still think you should avoid using the Elements name here, because it's not
> really a term we use in the API. Also a comment on what this does and that the
> 'embedder' still owns the data would be nice.

Changed to SetIndexedPropertiesToPixelData to be inline with other naming within
this file.

http://codereview.chromium.org/159263/diff/55/59
File src/api.cc (right):

http://codereview.chromium.org/159263/diff/55/59#newcode2201
Line 2201: i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(length,
data);
On 2009/07/28 06:07:27, Kasper Lund wrote:
> Should we have an API check (that also checks in release mode) that self isn't
a
> JSArray? I think that would be nice given the constraints of the current
> implementation. Maybe also check that length is a valid smi?

Done.

http://codereview.chromium.org/159263/diff/55/65
File src/api.h (right):

http://codereview.chromium.org/159263/diff/55/65#newcode102
Line 102: ASSERT(value()->GetElementsKind() ==
On 2009/07/28 06:07:27, Kasper Lund wrote:
> Keep as HasFastElements?

Done.

http://codereview.chromium.org/159263/diff/55/65#newcode109
Line 109: ASSERT(value_->GetElementsKind() ==
On 2009/07/28 06:07:27, Kasper Lund wrote:
> Keep as HasFastElements?

Done.

http://codereview.chromium.org/159263/diff/55/64
File src/ia32/ic-ia32.cc (right):

http://codereview.chromium.org/159263/diff/55/64#newcode287
Line 287: // Check whether the elements are a pixel array.
On 2009/07/28 06:07:27, Kasper Lund wrote:
> are -> is

Done.

http://codereview.chromium.org/159263/diff/55/62
File src/objects.cc (right):

http://codereview.chromium.org/159263/diff/55/62#newcode1676
Line 1676: switch (JSObject::cast(pt)->GetElementsKind()) {
On 2009/07/28 06:07:27, Kasper Lund wrote:
> It might be clearer with !JSObject::cast(pt)->HasDictionaryElements, but I'm
> okay either way.

Done.

http://codereview.chromium.org/159263/diff/55/62#newcode5879
Line 5879: case PIXEL_ELEMENTS: {
On 2009/07/28 06:07:27, Kasper Lund wrote:
> Move above the DICTIONARY_ELEMENTS case to match the more common ordering.

Done.

http://codereview.chromium.org/159263/diff/55/67
File src/objects.h (right):

http://codereview.chromium.org/159263/diff/55/67#newcode115
Line 115: class Array;
On 2009/07/28 06:07:27, Kasper Lund wrote:
> Move this to globals.h?

Done.

http://codereview.chromium.org/159263/diff/55/67#newcode2472
Line 2472: // This accessor applies the correct conversion and clamping on the
value.
On 2009/07/28 06:07:27, Kasper Lund wrote:
> Maybe extend the comment to state that it only deals with numbers and
undefined
> values?

Done.

Powered by Google App Engine
This is Rietveld 408576698