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

Issue 9403018: Implement fast literal support in Crankshaft. (Closed)

Created:
8 years, 10 months ago by Michael Starzinger
Modified:
8 years, 10 months ago
Reviewers:
danno
CC:
v8-dev
Visibility:
Public.

Description

Implement fast literal support in Crankshaft. This extends the current support for nested object literals we already have in Crankshaft, to also support nested array literals and mixed nested literals containing arrays and objects. All three types are generated by the unified HFastLiteral instruction. All previous upper bounds on nested literal graphs remain unchanged, keeping the size of generated code in check. The main intention is to boost performance of two-dimensional array literals containing constant elements (aka. matrices). R=danno@chromium.org TEST=mjsunit/compiler/literals-optimized Committed: https://code.google.com/p/v8/source/detail?r=10734

Patch Set 1 #

Total comments: 12

Patch Set 2 : Addressed comments by Daniel Clifford. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+518 lines, -210 lines) Patch
M src/arm/lithium-arm.h View 3 chunks +11 lines, -11 lines 0 comments Download
M src/arm/lithium-arm.cc View 1 chunk +6 lines, -7 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 3 chunks +52 lines, -12 lines 0 comments Download
M src/hydrogen.cc View 1 5 chunks +66 lines, -36 lines 0 comments Download
M src/hydrogen-instructions.h View 6 chunks +46 lines, -46 lines 0 comments Download
M src/hydrogen-instructions.cc View 1 chunk +6 lines, -5 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 3 chunks +51 lines, -12 lines 0 comments Download
M src/ia32/lithium-ia32.h View 3 chunks +14 lines, -14 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 chunk +6 lines, -7 lines 0 comments Download
M src/mips/lithium-codegen-mips.cc View 1 3 chunks +53 lines, -12 lines 0 comments Download
M src/mips/lithium-mips.h View 3 chunks +11 lines, -11 lines 0 comments Download
M src/mips/lithium-mips.cc View 1 chunk +6 lines, -7 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 3 chunks +52 lines, -12 lines 0 comments Download
M src/x64/lithium-x64.h View 3 chunks +11 lines, -11 lines 0 comments Download
M src/x64/lithium-x64.cc View 1 chunk +6 lines, -7 lines 0 comments Download
A test/mjsunit/compiler/literals-optimized.js View 1 chunk +121 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Michael Starzinger
8 years, 10 months ago (2012-02-15 16:19:27 UTC) #1
danno
LGTM with comments. There are a few places I didn't comment where you could share ...
8 years, 10 months ago (2012-02-16 16:09:36 UTC) #2
Michael Starzinger
8 years, 10 months ago (2012-02-16 17:34:37 UTC) #3
Added new patch set. Landed.

https://chromiumcodereview.appspot.com/9403018/diff/1/src/arm/lithium-codegen...
File src/arm/lithium-codegen-arm.cc (right):

https://chromiumcodereview.appspot.com/9403018/diff/1/src/arm/lithium-codegen...
src/arm/lithium-codegen-arm.cc:4385: bool has_elements = elements->length() > 0
&&
On 2012/02/16 16:09:37, danno wrote:
> The empty fixed array should always be used when the length is zero, and it's
> also COW. You could optionally add some asserts.

Actually adding an assertion that all non-COW arrays have length > 0 fails all
over the place. As discussed offline I will leave the current check in. I'll
investigate where those "empty non-COW arrays" come from.

https://chromiumcodereview.appspot.com/9403018/diff/1/src/arm/lithium-codegen...
src/arm/lithium-codegen-arm.cc:4403: __ str(r2, FieldMemOperand(result,
object_offset + i));
On 2012/02/16 16:09:37, danno wrote:
> The store is the same and can be moved out of the if.

Done.

https://chromiumcodereview.appspot.com/9403018/diff/1/src/hydrogen.cc
File src/hydrogen.cc (right):

https://chromiumcodereview.appspot.com/9403018/diff/1/src/hydrogen.cc#newcode...
src/hydrogen.cc:3447: if (max_depth <= 0) return false;
On 2012/02/16 16:09:37, danno wrote:
> Don't you want to return on 0 and assert that it's not negative?

Done.

https://chromiumcodereview.appspot.com/9403018/diff/1/src/hydrogen.cc#newcode...
src/hydrogen.cc:3451: elements->map() !=
boilerplate->GetHeap()->fixed_cow_array_map()) {
On 2012/02/16 16:09:37, danno wrote:
> length check unnecessary.

See response to first comment.

https://chromiumcodereview.appspot.com/9403018/diff/1/src/mips/lithium-codege...
File src/mips/lithium-codegen-mips.cc (right):

https://chromiumcodereview.appspot.com/9403018/diff/1/src/mips/lithium-codege...
src/mips/lithium-codegen-mips.cc:4295: __ sw(a2, FieldMemOperand(result,
object_offset + i));
On 2012/02/16 16:09:37, danno wrote:
> Factor our after if

Done.

https://chromiumcodereview.appspot.com/9403018/diff/1/src/x64/lithium-codegen...
File src/x64/lithium-codegen-x64.cc (right):

https://chromiumcodereview.appspot.com/9403018/diff/1/src/x64/lithium-codegen...
src/x64/lithium-codegen-x64.cc:3999: __ movq(FieldOperand(result, object_offset
+ i), rcx);
On 2012/02/16 16:09:37, danno wrote:
> After if

Done.

Powered by Google App Engine
This is Rietveld 408576698