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

Issue 55933002: Inline array constructor. (Closed)

Created:
7 years, 1 month ago by mvstanton
Modified:
7 years, 1 month ago
Reviewers:
Toon Verwaest, danno
CC:
v8-dev
Visibility:
Public.

Description

Inline zero argument array constructor. patch from issue 54583003 (dependent code). Zero arguments - very easy 1 argument - three special cases: a) If length is a constant in valid array length range, no need to check it at runtime. b) respect DoNotInline feedback on the AllocationSite for cases that the argument is not a smi or is an integer with a length that should create a dictionary. c) if kind feedback is non-holey, and length is non-constant, we'd have to generate a lot of code to be correct. Don't inline this case. N arguments - one special case: a) If a deopt ever occurs because an input argument isn't compatible with the elements kind, then set the DoNotInline flag. BUG= R=verwaest@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=17741

Patch Set 1 #

Patch Set 2 : Now inline all array constructors up to 5 arguments #

Patch Set 3 : Better code generation if array length is constant. #

Patch Set 4 : Optimized single argument constructor. #

Patch Set 5 : REBASE #

Patch Set 6 : Even better codegen for 1 arg case, and refactoring. #

Total comments: 33

Patch Set 7 : Comment response, inline tracing, and making HForceRepresentation idef #

Total comments: 30

Patch Set 8 : Addressed feedback. #

Patch Set 9 : REBASE #

Patch Set 10 : Ports #

Patch Set 11 : Improved arm generated code #

Patch Set 12 : REBASE #

Patch Set 13 : Added comment to CreateArrayDispatchOneArgument #

Unified diffs Side-by-side diffs Delta from patch set Stats (+439 lines, -125 lines) Patch
M src/arm/code-stubs-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +9 lines, -5 lines 0 comments Download
M src/arm/stub-cache-arm.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M src/code-stubs-hydrogen.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +8 lines, -23 lines 0 comments Download
M src/elements-kind.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M src/elements-kind.cc View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M src/heap.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -2 lines 0 comments Download
M src/hydrogen.h View 1 2 3 4 5 6 7 8 4 chunks +16 lines, -2 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 6 7 8 9 10 11 11 chunks +197 lines, -33 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +9 lines, -4 lines 0 comments Download
M src/ia32/stub-cache-ia32.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +38 lines, -3 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 8 5 chunks +52 lines, -19 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +16 lines, -0 lines 0 comments Download
M src/objects-printer.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -11 lines 0 comments Download
M src/runtime.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +23 lines, -11 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +9 lines, -4 lines 0 comments Download
M src/x64/stub-cache-x64.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/array-constructor-feedback.js View 1 2 3 4 5 6 7 4 chunks +40 lines, -5 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
mvstanton
PTAL. Inline array constructors. thx! --Michael
7 years, 1 month ago (2013-11-05 09:27:39 UTC) #1
Toon Verwaest
https://codereview.chromium.org/55933002/diff/170001/src/hydrogen.cc File src/hydrogen.cc (left): https://codereview.chromium.org/55933002/diff/170001/src/hydrogen.cc#oldcode7284 src/hydrogen.cc:7284: HValue* constructor = HPushArgument::cast(Top())->argument(); Why is it ok to ...
7 years, 1 month ago (2013-11-06 16:42:44 UTC) #2
mvstanton
thx for comments Toon. I had to make a change to HForceRepresentation to restore a ...
7 years, 1 month ago (2013-11-07 16:34:04 UTC) #3
Toon Verwaest
https://codereview.chromium.org/55933002/diff/310001/src/code-stubs-hydrogen.cc File src/code-stubs-hydrogen.cc (right): https://codereview.chromium.org/55933002/diff/310001/src/code-stubs-hydrogen.cc#newcode712 src/code-stubs-hydrogen.cc:712: : JSArrayBuilder::DONT_FILL_WITH_HOLE; Technically we don't need to fill this ...
7 years, 1 month ago (2013-11-11 13:59:27 UTC) #4
mvstanton
Hi Toon, addressed feedback. I extracted the HForceRepresentation idef into another CL I should land ...
7 years, 1 month ago (2013-11-13 14:12:51 UTC) #5
Toon Verwaest
lgtm
7 years, 1 month ago (2013-11-13 14:59:39 UTC) #6
mvstanton
Hi Toon, will you quickly check over the ARM & x64 ports in code-stubs-<platform>.cc? All ...
7 years, 1 month ago (2013-11-13 20:42:23 UTC) #7
mvstanton
7 years, 1 month ago (2013-11-14 12:05:27 UTC) #8
Message was sent while issue was closed.
Committed patchset #13 manually as r17741 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698