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

Issue 1989363004: [turbofan] Add FixedArray peephole optimizations to CodeStubAssembler (Closed)

Created:
4 years, 7 months ago by danno
Modified:
4 years, 7 months ago
Reviewers:
Michael Starzinger
CC:
v8-reviews_googlegroups.com, oth, rmcilroy
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[turbofan] Add FixedArray peephole optimizations to CodeStubAssembler Previously, CodeStubAssembler macros performing FixedArray element accesses had to compute offsets to elements explicitly with a fair amount of duplicated code. Furthermore, any peephole optimizations that could produce better code-- like recognizing constant indices or combining array index computation with Smi untagging--were also duplicated. This change factors the code to compute FixedArray index offsets into a common routine in the CodeStubAssembler that applies standard peephole optimizations to all accesses. In order to do this, it also introduces limited introspection into the up-until-now opaque Node* type exported from code-assembler.h, allowing Nodes to be queried whether they are constant and extracting their constant value in that case. Committed: https://crrev.com/cbdb373804585d18351e9b5c25a1cad33a4058c7 Cr-Commit-Position: refs/heads/master@{#36370}

Patch Set 1 #

Patch Set 2 : Tweaks #

Patch Set 3 : Fix test #

Total comments: 8

Patch Set 4 : Review feedback #

Total comments: 4

Patch Set 5 : Even simpler #

Patch Set 6 : Add test case #

Patch Set 7 : Final review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+202 lines, -153 lines) Patch
M src/code-stub-assembler.h View 1 2 3 4 5 5 chunks +22 lines, -28 lines 0 comments Download
M src/code-stub-assembler.cc View 1 2 3 4 5 6 12 chunks +92 lines, -102 lines 0 comments Download
M src/code-stubs.cc View 1 4 chunks +12 lines, -10 lines 0 comments Download
M src/compiler/code-assembler.h View 1 2 3 4 5 2 chunks +6 lines, -1 line 0 comments Download
M src/compiler/code-assembler.cc View 1 2 3 4 5 3 chunks +30 lines, -1 line 0 comments Download
M src/interpreter/interpreter.cc View 1 2 chunks +4 lines, -3 lines 0 comments Download
M src/interpreter/interpreter-assembler.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M test/cctest/compiler/test-code-stub-assembler.cc View 1 2 3 4 5 2 chunks +30 lines, -2 lines 0 comments Download
M test/unittests/interpreter/interpreter-assembler-unittest.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (6 generated)
danno
PTAL
4 years, 7 months ago (2016-05-19 09:38:52 UTC) #3
Michael Starzinger
https://codereview.chromium.org/1989363004/diff/40001/src/compiler/code-assembler.cc File src/compiler/code-assembler.cc (right): https://codereview.chromium.org/1989363004/diff/40001/src/compiler/code-assembler.cc#newcode131 src/compiler/code-assembler.cc:131: if (node->opcode() == IrOpcode::kInt32Constant) { Can we use an ...
4 years, 7 months ago (2016-05-19 10:54:21 UTC) #4
danno
thanks for the feedback, great suggestions. please take another look. https://codereview.chromium.org/1989363004/diff/40001/src/compiler/code-assembler.cc File src/compiler/code-assembler.cc (right): https://codereview.chromium.org/1989363004/diff/40001/src/compiler/code-assembler.cc#newcode131 ...
4 years, 7 months ago (2016-05-19 11:10:18 UTC) #5
Michael Starzinger
LGTM. Just nits left. https://codereview.chromium.org/1989363004/diff/60001/src/code-stub-assembler.cc File src/code-stub-assembler.cc (right): https://codereview.chromium.org/1989363004/diff/60001/src/code-stub-assembler.cc#newcode249 src/code-stub-assembler.cc:249: constant_value <= Smi::kMaxValue); nit: DCHECK(Smi::IsValid(constant_value)) ...
4 years, 7 months ago (2016-05-19 11:19:17 UTC) #6
danno
Thanks for the feedback, which I addressed. Landing. https://codereview.chromium.org/1989363004/diff/60001/src/code-stub-assembler.cc File src/code-stub-assembler.cc (right): https://codereview.chromium.org/1989363004/diff/60001/src/code-stub-assembler.cc#newcode249 src/code-stub-assembler.cc:249: constant_value ...
4 years, 7 months ago (2016-05-19 14:25:49 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1989363004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1989363004/120001
4 years, 7 months ago (2016-05-19 14:26:00 UTC) #10
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 7 months ago (2016-05-19 15:49:10 UTC) #12
commit-bot: I haz the power
4 years, 7 months ago (2016-05-19 15:50:44 UTC) #14
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/cbdb373804585d18351e9b5c25a1cad33a4058c7
Cr-Commit-Position: refs/heads/master@{#36370}

Powered by Google App Engine
This is Rietveld 408576698