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

Issue 597022: Port FastCloneShallowArrayStub to ARM and x64. (Closed)

Created:
10 years, 10 months ago by Mads Ager (chromium)
Modified:
9 years, 7 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Port FastCloneShallowArrayStub to ARM and x64. Committed: http://code.google.com/p/v8/source/detail?r=3835

Patch Set 1 #

Total comments: 10

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -8 lines) Patch
M src/arm/codegen-arm.cc View 1 2 chunks +69 lines, -4 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 2 chunks +63 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (chromium)
10 years, 10 months ago (2010-02-10 14:52:29 UTC) #1
Lasse Reichstein
LGTM. http://codereview.chromium.org/597022/diff/1/3 File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/597022/diff/1/3#newcode4522 src/arm/codegen-arm.cc:4522: int size = JSArray::kSize + elements_size; Pedantically, you ...
10 years, 10 months ago (2010-02-10 17:41:27 UTC) #2
Mads Ager (chromium)
10 years, 10 months ago (2010-02-11 12:24:02 UTC) #3
http://codereview.chromium.org/597022/diff/1/3
File src/arm/codegen-arm.cc (right):

http://codereview.chromium.org/597022/diff/1/3#newcode4522
src/arm/codegen-arm.cc:4522: int size = JSArray::kSize + elements_size;
On 2010/02/10 17:41:27, Lasse Reichstein wrote:
> Pedantically, you should assert that either of the sizes is a multiple of
> kObjectAlignment (otherwise the sum might be less than what is needed for two
> aligned objects). A comment should suffice.

Added a comment stating that all sizes here are multiples of kPointerSize.

http://codereview.chromium.org/597022/diff/1/3#newcode4526
src/arm/codegen-arm.cc:4526: Label slow_case;
On 2010/02/10 17:41:27, Lasse Reichstein wrote:
> Please add a comment stating the order of arguments on the stack, or make
> constants for their offsets.

Done.

http://codereview.chromium.org/597022/diff/1/3#newcode4548
src/arm/codegen-arm.cc:4548: __ str(r1, FieldMemOperand(r0, i));
On 2010/02/10 17:41:27, Lasse Reichstein wrote:
> There are only seven or eight fields to copy. If you unroll the loop manually,
> you can interleave the loads and stores, putting an instruction between each
> load and a dependent store.

Good point.  Let's experiment with that on all platforms as a separate change.

http://codereview.chromium.org/597022/diff/1/3#newcode4562
src/arm/codegen-arm.cc:4562: __ str(r1, FieldMemOperand(r2, i));
On 2010/02/10 17:41:27, Lasse Reichstein wrote:
> A single unrolling (two loads followed by two stores in each iteration +
> potentially a single copy at the end for parity) would reduce the wasted
cycles.
> 
> If you have lots of free registers, you can consider using ldrm/strm to load
and
> store several in few instructions.

Good point.  Let's experiment with that on all platforms as a separate change.

http://codereview.chromium.org/597022/diff/1/2
File src/x64/codegen-x64.cc (right):

http://codereview.chromium.org/597022/diff/1/2#newcode6300
src/x64/codegen-x64.cc:6300: for (int i = 0; i < elements_size; i +=
kPointerSize) {
On 2010/02/10 17:41:27, Lasse Reichstein wrote:
> If elements_size gets big (for some value of "big"), it might be better to
make
> a computed loop in that case.
> If that's not expected to happen, this should be fine.

Elements size is bounded because we check for
FastCloneShallowArrayStub::kMaximumLength before calling the stub.

Powered by Google App Engine
This is Rietveld 408576698