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

Issue 7600025: Create a common subclass for arrays (Closed)

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

Description

Create a common base class for Fixed-, FixedDouble- and ExternalArrays. Also unify Crankshaft code to load array length. BUG=v8:1493 TEST=external-arrays.js Committed: http://code.google.com/p/v8/source/detail?r=8901

Patch Set 1 #

Patch Set 2 : merged with tot #

Patch Set 3 : merge with latest #

Patch Set 4 : ia32 implementation #

Patch Set 5 : implement x64, arm, mips #

Total comments: 10

Patch Set 6 : review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+172 lines, -283 lines) Patch
M src/arm/lithium-arm.h View 1 2 3 4 2 chunks +6 lines, -17 lines 0 comments Download
M src/arm/lithium-arm.cc View 1 2 3 4 5 1 chunk +3 lines, -9 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 2 3 4 5 1 chunk +2 lines, -9 lines 0 comments Download
M src/arm/stub-cache-arm.cc View 1 2 3 4 5 10 chunks +21 lines, -25 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 4 chunks +4 lines, -4 lines 0 comments Download
M src/hydrogen-instructions.h View 1 2 3 4 3 chunks +4 lines, -26 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 1 chunk +3 lines, -9 lines 0 comments Download
M src/ia32/lithium-ia32.h View 1 2 3 4 2 chunks +6 lines, -17 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 2 3 4 5 1 chunk +3 lines, -9 lines 0 comments Download
M src/ia32/stub-cache-ia32.cc View 1 2 3 4 5 9 chunks +40 lines, -57 lines 0 comments Download
M src/mips/stub-cache-mips.cc View 1 2 3 4 5 2 chunks +5 lines, -5 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 7 chunks +14 lines, -25 lines 0 comments Download
M src/objects-inl.h View 1 chunk +0 lines, -6 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 4 5 1 chunk +2 lines, -9 lines 0 comments Download
M src/x64/lithium-x64.h View 1 2 3 4 2 chunks +6 lines, -17 lines 0 comments Download
M src/x64/lithium-x64.cc View 1 2 3 4 5 1 chunk +3 lines, -9 lines 0 comments Download
M src/x64/stub-cache-x64.cc View 1 2 3 4 8 chunks +30 lines, -30 lines 0 comments Download
M test/mjsunit/external-array.js View 1 2 3 4 2 chunks +20 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
danno
Please reviews.
9 years, 4 months ago (2011-08-10 13:19:58 UTC) #1
Kevin Millikin (Chromium)
LGTM. http://codereview.chromium.org/7600025/diff/7008/src/arm/stub-cache-arm.cc File src/arm/stub-cache-arm.cc (right): http://codereview.chromium.org/7600025/diff/7008/src/arm/stub-cache-arm.cc#newcode3817 src/arm/stub-cache-arm.cc:3817: __ JumpIfNotSmi(key, &miss_force_generic); Moving this check first slightly ...
9 years, 4 months ago (2011-08-11 08:13:06 UTC) #2
danno
9 years, 4 months ago (2011-08-11 13:59:37 UTC) #3
feedback addressed. landing.

http://codereview.chromium.org/7600025/diff/7008/src/arm/stub-cache-arm.cc
File src/arm/stub-cache-arm.cc (right):

http://codereview.chromium.org/7600025/diff/7008/src/arm/stub-cache-arm.cc#ne...
src/arm/stub-cache-arm.cc:3817: __ JumpIfNotSmi(key, &miss_force_generic);
On 2011/08/11 08:13:06, Kevin Millikin wrote:
> Moving this check first slightly speeds up the miss case by avoiding the
> elements load.

Done.

http://codereview.chromium.org/7600025/diff/7008/src/arm/stub-cache-arm.cc#ne...
src/arm/stub-cache-arm.cc:3820: __ SmiUntag(r4, key);
On 2011/08/11 08:13:06, Kevin Millikin wrote:
> If you push the untagging down to all the current uses of r4, I think most of
> them can avoid the untagging.  (Maybe only the EXTERNAL_FLOAT_ELEMENTS case
> can't?)

Done.

http://codereview.chromium.org/7600025/diff/7008/src/ia32/stub-cache-ia32.cc
File src/ia32/stub-cache-ia32.cc (right):

http://codereview.chromium.org/7600025/diff/7008/src/ia32/stub-cache-ia32.cc#...
src/ia32/stub-cache-ia32.cc:3576: __ mov(ebx, eax);  // Preserve the value in
ebx.
On 2011/08/11 08:13:06, Kevin Millikin wrote:
> I don't understand the comment anymore.  The value in ebx is immediately
> changed.  I think it's obvious that this move is to avoid destroying eax by
the
> untag, so I'd focus on why:
> 
> // Preserve the value in eax as the return value.

Done.

http://codereview.chromium.org/7600025/diff/7008/src/objects.h
File src/objects.h (right):

http://codereview.chromium.org/7600025/diff/7008/src/objects.h#newcode65
src/objects.h:65: //       - FixedArrayBase
I hate the name, too, but I'd like to fix that in another CL.

On 2011/08/11 08:13:06, Kevin Millikin wrote:
> I don't like this name, because FixedArray is one of the subclasses.  The sane
> thing is to call the base class "FixedArray" and the current FixedArray class
> "ObjectArray" (because it contains Objects as elements).  And FixedDoubleArray
> could become DoubleArray.
> 
> There are some problems with that suggestion.  "Object" is already overloaded
to
> the point of confusion.  To a much lesser extent, the V8 devs are used to a
> specific meaning of "FixedArray".
> 
> I can't think of anything better.

http://codereview.chromium.org/7600025/diff/7008/src/objects.h#newcode3143
src/objects.h:3143: POINTER_SIZE_ALIGN(kLengthOffset + kPointerSize);
On 2011/08/11 08:13:06, Kevin Millikin wrote:
> Hmmm.  Can you write FixedArrayBase::kLengthOffset to be clear where the
length
> is coming from?

Done.

Powered by Google App Engine
This is Rietveld 408576698