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

Issue 10170030: Implement tracking and optimizations of packed arrays (Closed)

Created:
8 years, 8 months ago by danno
Modified:
8 years, 7 months ago
Reviewers:
Jakob Kummerow
CC:
v8-dev
Visibility:
Public.

Description

Implement tracking and optimizations of packed arrays R=jkummerow@chromium.org TEST=jkummerow@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=11636

Patch Set 1 #

Patch Set 2 : nits #

Patch Set 3 : More changes #

Patch Set 4 : Fix regressions when packed arrays are off #

Patch Set 5 : More regression fixes #

Patch Set 6 : ia32 ready to go #

Total comments: 82

Patch Set 7 : Platforms ports and review feedback #

Total comments: 24

Patch Set 8 : Rebase to bleeding_edge #

Patch Set 9 : Review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2311 lines, -1206 lines) Patch
M src/SConscript View 1 chunk +1 line, -0 lines 0 comments Download
M src/api.h View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M src/api.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/arm/builtins-arm.cc View 1 2 3 4 5 6 3 chunks +5 lines, -4 lines 0 comments Download
M src/arm/code-stubs-arm.cc View 1 2 3 4 5 6 4 chunks +7 lines, -7 lines 0 comments Download
M src/arm/codegen-arm.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 6 7 3 chunks +3 lines, -4 lines 0 comments Download
M src/arm/ic-arm.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -7 lines 0 comments Download
M src/arm/lithium-arm.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 2 3 4 5 6 7 8 7 chunks +31 lines, -17 lines 0 comments Download
M src/arm/macro-assembler-arm.h View 1 2 3 4 5 6 2 chunks +5 lines, -4 lines 0 comments Download
M src/arm/macro-assembler-arm.cc View 1 2 3 4 5 6 4 chunks +48 lines, -38 lines 0 comments Download
M src/arm/stub-cache-arm.cc View 1 2 3 4 5 6 7 8 9 chunks +39 lines, -11 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 6 7 3 chunks +3 lines, -3 lines 0 comments Download
M src/builtins.cc View 1 2 3 4 5 6 7 20 chunks +56 lines, -31 lines 0 comments Download
M src/code-stubs.cc View 1 2 3 4 5 6 7 8 4 chunks +23 lines, -9 lines 0 comments Download
M src/codegen.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -3 lines 0 comments Download
M src/contexts.h View 3 chunks +2 lines, -18 lines 0 comments Download
M src/elements.h View 1 2 3 4 5 6 2 chunks +5 lines, -0 lines 0 comments Download
M src/elements.cc View 1 2 3 4 5 6 24 chunks +264 lines, -106 lines 0 comments Download
A src/elements-kind.h View 1 2 3 4 5 6 7 8 1 chunk +209 lines, -0 lines 0 comments Download
A src/elements-kind.cc View 1 2 3 4 5 6 1 chunk +134 lines, -0 lines 0 comments Download
M src/factory.h View 3 chunks +10 lines, -7 lines 0 comments Download
M src/factory.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M src/heap.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/heap.cc View 1 2 3 4 5 6 7 10 chunks +18 lines, -17 lines 0 comments Download
M src/hydrogen.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 6 7 15 chunks +71 lines, -43 lines 0 comments Download
M src/hydrogen-instructions.h View 1 2 3 4 5 6 7 7 chunks +53 lines, -34 lines 0 comments Download
M src/hydrogen-instructions.cc View 1 2 3 5 chunks +19 lines, -4 lines 0 comments Download
M src/ia32/builtins-ia32.cc View 1 2 3 4 5 3 chunks +5 lines, -4 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 3 4 5 6 4 chunks +8 lines, -8 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 5 6 7 4 chunks +8 lines, -8 lines 0 comments Download
M src/ia32/ic-ia32.cc View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -8 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 6 7 8 7 chunks +34 lines, -21 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 1 2 3 4 5 6 2 chunks +5 lines, -4 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 2 3 4 5 6 4 chunks +49 lines, -39 lines 0 comments Download
M src/ia32/stub-cache-ia32.cc View 1 2 3 4 5 6 7 8 4 chunks +21 lines, -6 lines 0 comments Download
M src/ic.h View 1 2 3 1 chunk +7 lines, -1 line 0 comments Download
M src/ic.cc View 1 2 3 4 chunks +49 lines, -16 lines 0 comments Download
M src/jsregexp.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M src/lithium.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M src/mips/builtins-mips.cc View 1 2 3 4 5 6 3 chunks +5 lines, -4 lines 0 comments Download
M src/mips/code-stubs-mips.cc View 1 2 3 4 5 6 5 chunks +8 lines, -8 lines 0 comments Download
M src/mips/codegen-mips.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M src/mips/full-codegen-mips.cc View 1 2 3 4 5 6 7 3 chunks +4 lines, -4 lines 0 comments Download
M src/mips/ic-mips.cc View 1 2 3 4 5 6 7 8 2 chunks +12 lines, -11 lines 0 comments Download
M src/mips/lithium-codegen-mips.cc View 1 2 3 4 5 6 7 8 7 chunks +29 lines, -16 lines 0 comments Download
M src/mips/lithium-mips.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download
M src/mips/macro-assembler-mips.h View 1 2 3 4 5 6 2 chunks +5 lines, -4 lines 0 comments Download
M src/mips/macro-assembler-mips.cc View 1 2 3 4 5 6 3 chunks +49 lines, -38 lines 0 comments Download
M src/mips/stub-cache-mips.cc View 1 2 3 4 5 6 7 8 10 chunks +39 lines, -12 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 10 chunks +42 lines, -65 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 42 chunks +269 lines, -179 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 4 5 6 7 5 chunks +17 lines, -6 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 18 chunks +122 lines, -112 lines 0 comments Download
M src/objects-printer.cc View 1 2 3 4 5 6 2 chunks +4 lines, -1 line 0 comments Download
M src/parser.cc View 5 chunks +16 lines, -4 lines 0 comments Download
M src/profile-generator.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -2 lines 0 comments Download
M src/runtime.cc View 1 2 3 4 5 6 7 37 chunks +130 lines, -84 lines 0 comments Download
M src/string-stream.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/x64/builtins-x64.cc View 1 2 3 4 5 6 3 chunks +5 lines, -4 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 1 2 3 4 5 6 4 chunks +8 lines, -8 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 6 7 4 chunks +8 lines, -8 lines 0 comments Download
M src/x64/ic-x64.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -7 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 4 5 6 7 8 7 chunks +37 lines, -24 lines 0 comments Download
M src/x64/lithium-x64.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download
M src/x64/macro-assembler-x64.h View 1 2 3 4 5 6 2 chunks +5 lines, -4 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 1 2 3 4 5 6 4 chunks +49 lines, -39 lines 0 comments Download
M src/x64/stub-cache-x64.cc View 1 2 3 4 5 6 7 8 5 chunks +31 lines, -10 lines 0 comments Download
M test/cctest/test-heap.cc View 1 2 3 4 5 6 7 3 chunks +5 lines, -3 lines 0 comments Download
M test/mjsunit/array-construct-transition.js View 1 chunk +3 lines, -3 lines 0 comments Download
M test/mjsunit/array-literal-transitions.js View 1 2 3 4 5 6 6 chunks +10 lines, -10 lines 0 comments Download
M test/mjsunit/elements-kind.js View 1 2 3 4 5 6 3 chunks +4 lines, -4 lines 0 comments Download
M test/mjsunit/elements-transition.js View 3 chunks +5 lines, -5 lines 0 comments Download
M test/mjsunit/elements-transition-hoisting.js View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
A test/mjsunit/packed-elements.js View 1 2 3 4 5 6 1 chunk +112 lines, -0 lines 0 comments Download
M test/mjsunit/regress/regress-117409.js View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/regress/regress-1849.js View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
M test/mjsunit/regress/regress-1878.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/regress/regress-crbug-122271.js View 1 chunk +4 lines, -4 lines 0 comments Download
M test/mjsunit/regress/regress-smi-only-concat.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/unbox-double-arrays.js View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
danno
Please take a look. Only ia32 implementation is ready to go right now, I'm following ...
8 years, 7 months ago (2012-05-08 15:39:15 UTC) #1
Jakob Kummerow
Some comments: a few real issues and a bunch of nits. These apply to patch ...
8 years, 7 months ago (2012-05-13 21:55:27 UTC) #2
danno
Please take another look. http://codereview.chromium.org/10170030/diff/9002/src/elements-kind.cc File src/elements-kind.cc (right): http://codereview.chromium.org/10170030/diff/9002/src/elements-kind.cc#newcode55 src/elements-kind.cc:55: ElementsKind **fast_elements_kind_sequence_ptr) { On 2012/05/13 ...
8 years, 7 months ago (2012-05-22 11:05:20 UTC) #3
Jakob Kummerow
Finally, the moment you've been waiting for for a long, long time... *drumroll* LGTM WITH ...
8 years, 7 months ago (2012-05-22 17:36:49 UTC) #4
danno
8 years, 7 months ago (2012-05-23 14:25:36 UTC) #5
Feedback addressed. Landing.

http://codereview.chromium.org/10170030/diff/18004/src/arm/lithium-codegen-ar...
File src/arm/lithium-codegen-arm.cc (right):

http://codereview.chromium.org/10170030/diff/18004/src/arm/lithium-codegen-ar...
src/arm/lithium-codegen-arm.cc:3915: IsFastElementsKind(to_kind)) {
On 2012/05/22 17:36:49, Jakob wrote:
> IsFastObjectElementsKind(to_kind) ?

Done.

http://codereview.chromium.org/10170030/diff/18004/src/codegen.h
File src/codegen.h (right):

http://codereview.chromium.org/10170030/diff/18004/src/codegen.h#newcode98
src/codegen.h:98: static void GenerateMapChangeElementTransition(MacroAssembler*
masm);
On 2012/05/22 17:36:49, Jakob wrote:
> nit: for naming consistency, I'd add an 's':
> Element*s*TransitionGenerator::GenerateMapChangeElement*s*Transition

Done.

http://codereview.chromium.org/10170030/diff/18004/src/elements-kind.h
File src/elements-kind.h (right):

http://codereview.chromium.org/10170030/diff/18004/src/elements-kind.h#newcod...
src/elements-kind.h:136: !IsHoleyElementsKind(kind);
On 2012/05/22 17:36:49, Jakob wrote:
> nit: IsFastHoleyElementsKind would be ever so slightly faster.

Done.

http://codereview.chromium.org/10170030/diff/18004/src/flag-definitions.h
File src/flag-definitions.h (right):

http://codereview.chromium.org/10170030/diff/18004/src/flag-definitions.h#new...
src/flag-definitions.h:153: DEFINE_bool(packed_arrays, true, "optimizes arrays
that have no holes")
On 2012/05/22 17:36:49, Jakob wrote:
> intentional?

Done.

http://codereview.chromium.org/10170030/diff/18004/src/ia32/lithium-codegen-i...
File src/ia32/lithium-codegen-ia32.cc (right):

http://codereview.chromium.org/10170030/diff/18004/src/ia32/lithium-codegen-i...
src/ia32/lithium-codegen-ia32.cc:3572: IsFastElementsKind(to_kind)) {
On 2012/05/22 17:36:49, Jakob wrote:
> IsFastObjectElementsKind(to_kind) ?

Done.

http://codereview.chromium.org/10170030/diff/18004/src/mips/lithium-codegen-m...
File src/mips/lithium-codegen-mips.cc (right):

http://codereview.chromium.org/10170030/diff/18004/src/mips/lithium-codegen-m...
src/mips/lithium-codegen-mips.cc:3705: IsFastElementsKind(to_kind)) {
On 2012/05/22 17:36:49, Jakob wrote:
> IsFastObjectElementsKind(to_kind) ?

Done.

http://codereview.chromium.org/10170030/diff/18004/src/mips/lithium-codegen-m...
src/mips/lithium-codegen-mips.cc:4461: if (boilerplate_elements_kind !=
TERMINAL_FAST_ELEMENTS_KIND) {
On 2012/05/22 17:36:49, Jakob wrote:
> Other arches ask "if
> (CanTransitionToMoreGeneralFastElementsKind(boilerplate_elements_kind, true))"
> here

Done.

http://codereview.chromium.org/10170030/diff/18004/src/objects-inl.h
File src/objects-inl.h (right):

http://codereview.chromium.org/10170030/diff/18004/src/objects-inl.h#newcode4857
src/objects-inl.h:4857: (IsFastSmiElementsKind(GetElementsKind()) &&
That's a little bit different. The () make sure that if it's Smi, then it can
contain only Smis or Holes.
On 2012/05/22 17:36:49, Jakob wrote:
> nit: could just use IsFastSmiOrObjectElementsKind

http://codereview.chromium.org/10170030/diff/18004/src/x64/lithium-codegen-x6...
File src/x64/lithium-codegen-x64.cc (right):

http://codereview.chromium.org/10170030/diff/18004/src/x64/lithium-codegen-x6...
src/x64/lithium-codegen-x64.cc:3515: IsFastElementsKind(to_kind)) {
On 2012/05/22 17:36:49, Jakob wrote:
> IsFastObjectElementsKind(to_kind) ?

Done.

http://codereview.chromium.org/10170030/diff/18004/src/x64/lithium-codegen-x6...
src/x64/lithium-codegen-x64.cc:4339: // already been converted to FAST_ELEMENTS.
On 2012/05/22 17:36:49, Jakob wrote:
> nit: s/FAST_ELEMENTS/TERMINAL_FAST_ELEMENTS_KIND/

Done.

http://codereview.chromium.org/10170030/diff/18004/src/x64/lithium-x64.cc
File src/x64/lithium-x64.cc (right):

http://codereview.chromium.org/10170030/diff/18004/src/x64/lithium-x64.cc#new...
src/x64/lithium-x64.cc:2017: bool simple_map_change =
(GetHoleyElementsKind(from_kind) == to_kind) ||
On 2012/05/22 17:36:49, Jakob wrote:
> This computation is used often enough that it would be nice to factor it out
> into elements-kind.h:
> 
> bool IsSimpleMapChange(ElementsKind from_kind, ElementsKind to_kind) {
>   return (GetHoleyElementsKind(from_kind) == to_kind) ||
>       (IsFastSmiElementsKind(from_kind) &&
>       IsFastObjectElementsKind(to_kind));
> }
> 
> But then again, this CL is large enough as it is, so feel free to postpone
such
> cleanup.

Done.

http://codereview.chromium.org/10170030/diff/18004/src/x64/stub-cache-x64.cc
File src/x64/stub-cache-x64.cc (right):

http://codereview.chromium.org/10170030/diff/18004/src/x64/stub-cache-x64.cc#...
src/x64/stub-cache-x64.cc:1452: __ movq(rdi, FieldOperand(rdx,
JSArray::kElementsOffset));
On 2012/05/22 17:36:49, Jakob wrote:
> You have rdi's original value in r9, can use that (or remove line 1440 and
copy
> this (1452) to 1463).

Done.

Powered by Google App Engine
This is Rietveld 408576698