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

Issue 2692753004: [turbofan] escape analysis supports arguments object and rest elements (Closed)

Created:
3 years, 10 months ago by Tobias Tebbi
Modified:
3 years, 9 months ago
CC:
v8-reviews_googlegroups.com, Igor Sheludko
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[turbofan] escape analysis supports arguments object and rest elements The new NewUnmappedArgumentsElements node now takes two inputs: - the frame holding the arguments (current frame or arguments adaptor frame) - the length of the suffix of passed arguments to be copied into the backing store These inputs are computed with two new node types: ArgumentsFrame() ArgumentsLength[formal_parameter_count,is_rest_length](Node* arguments_frame) The node type NewRestParameterElements can now be expressed with NewUnmappedArgumentsElements and an appropriate length and is thus not needed anymore. In escape analysis, we lower loads from the length field of NewUnmappedArgumentsElements with its length input and if we find out that no write access to the arguments elements exists, we replace element loads with direct stack access and replace the NewUnmappedArgumentsElements node with a node of the new node type ArgumentsElementsState. This corresponds to an ObjectState node and gets translated into a deoptimizer instruction to allocate the backing store. Together with the already existing deoptimizer support for the actual arguments object/rest parameters, this allows to remove all allocations for arguments objects/rest parameters in this case. In the deoptimizer, we read the actual parameters from the stack while transforming the static deopt info into TranslatedValue objects. If escape analysis cannot remove the backing store allocation, NewUnmappedArgumentsElements gets lo BUG=v8:5726 Review-Url: https://codereview.chromium.org/2692753004 Cr-Commit-Position: refs/heads/master@{#43475} Committed: https://chromium.googlesource.com/v8/v8/+/7467f16d737be89d9cac573a07026e477cff85db

Patch Set 1 #

Patch Set 2 : handle bounds check and added tests #

Patch Set 3 : added comments and fixed wrong type #

Patch Set 4 : switch to ZoneVector #

Total comments: 2

Patch Set 5 : cleaned up deoptimizer #

Patch Set 6 : replaced obscure for-loop #

Total comments: 8

Patch Set 7 : addressed comments #

Total comments: 9

Patch Set 8 : rebased #

Patch Set 9 : Rebased. #

Patch Set 10 : fix rebase error #

Patch Set 11 : addressed comments #

Patch Set 12 : adapted to changed frame tags #

Patch Set 13 : fixed typos #

Patch Set 14 : removed dead code #

Patch Set 15 : handle the case where Deoptimizer::function_ is a Smi #

Unified diffs Side-by-side diffs Delta from patch set Stats (+780 lines, -312 lines) Patch
M src/builtins/builtins.h View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -3 lines 0 comments Download
M src/builtins/builtins-internal.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -75 lines 0 comments Download
M src/code-factory.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M src/code-factory.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M src/compiler/code-generator.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M src/compiler/common-operator.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -1 line 0 comments Download
M src/compiler/common-operator.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +10 lines, -5 lines 0 comments Download
M src/compiler/effect-control-linearizer.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M src/compiler/effect-control-linearizer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +79 lines, -16 lines 0 comments Download
M src/compiler/escape-analysis-reducer.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M src/compiler/escape-analysis-reducer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +97 lines, -0 lines 0 comments Download
M src/compiler/graph-assembler.h View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M src/compiler/graph-assembler.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M src/compiler/instruction.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +38 lines, -19 lines 0 comments Download
M src/compiler/instruction-selector.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -3 lines 0 comments Download
M src/compiler/js-call-reducer.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -14 lines 0 comments Download
M src/compiler/js-create-lowering.cc View 1 2 3 4 5 6 7 8 6 chunks +32 lines, -23 lines 0 comments Download
M src/compiler/opcodes.h View 1 2 3 4 5 6 7 8 2 chunks +25 lines, -24 lines 0 comments Download
M src/compiler/simplified-lowering.cc View 1 2 3 4 5 6 7 8 2 chunks +12 lines, -4 lines 0 comments Download
M src/compiler/simplified-operator.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -4 lines 0 comments Download
M src/compiler/simplified-operator.cc View 1 2 3 4 5 6 7 4 chunks +60 lines, -24 lines 0 comments Download
M src/compiler/typer.cc View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -4 lines 0 comments Download
M src/compiler/verifier.cc View 1 2 3 4 5 6 7 3 chunks +12 lines, -2 lines 0 comments Download
M src/deoptimizer.h View 1 2 3 4 5 6 6 chunks +12 lines, -8 lines 0 comments Download
M src/deoptimizer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 21 chunks +188 lines, -45 lines 0 comments Download
M src/interface-descriptors.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M src/interface-descriptors.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -2 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M test/mjsunit/arguments-deopt.js View 1 12 4 chunks +109 lines, -30 lines 0 comments Download
A test/mjsunit/compiler/rest-parameters.js View 1 chunk +54 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (29 generated)
Tobias Tebbi
https://codereview.chromium.org/2692753004/diff/60001/src/compiler/escape-analysis-reducer.h File src/compiler/escape-analysis-reducer.h (right): https://codereview.chromium.org/2692753004/diff/60001/src/compiler/escape-analysis-reducer.h#newcode63 src/compiler/escape-analysis-reducer.h:63: std::set<Node*> arguments_elements_; This is a small set, at most ...
3 years, 10 months ago (2017-02-15 14:16:05 UTC) #2
Benedikt Meurer
LGTM. Adding jarin@ as 2nd reviewer.
3 years, 10 months ago (2017-02-15 14:45:02 UTC) #9
Jarin
I have only looked at the deoptimizer so far, and have some questions there. Overall, ...
3 years, 10 months ago (2017-02-15 16:17:15 UTC) #10
Jarin
lgtm once the comments are addressed. https://codereview.chromium.org/2692753004/diff/120001/src/compiler/common-operator.cc File src/compiler/common-operator.cc (right): https://codereview.chromium.org/2692753004/diff/120001/src/compiler/common-operator.cc#newcode1242 src/compiler/common-operator.cc:1242: int IsRestOf(Operator const* ...
3 years, 9 months ago (2017-02-27 13:24:34 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2692753004/260001
3 years, 9 months ago (2017-02-27 15:15:02 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux64_gyp_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_gyp_rel_ng/builds/13784)
3 years, 9 months ago (2017-02-27 15:19:33 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2692753004/280001
3 years, 9 months ago (2017-02-27 15:23:42 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux_arm64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm64_rel_ng/builds/17396) v8_linux_arm64_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, ...
3 years, 9 months ago (2017-02-27 15:44:41 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2692753004/300001
3 years, 9 months ago (2017-02-28 10:50:24 UTC) #35
commit-bot: I haz the power
Committed patchset #15 (id:300001) as https://chromium.googlesource.com/v8/v8/+/7467f16d737be89d9cac573a07026e477cff85db
3 years, 9 months ago (2017-02-28 11:16:34 UTC) #38
Michael Achenbach
Looks like we got slightly less predictable since this commit: https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20predictable/builds/10152 Any idea? +ishell
3 years, 9 months ago (2017-02-28 14:06:50 UTC) #40
Michael Achenbach
On 2017/02/28 14:06:50, Michael Achenbach wrote: > Looks like we got slightly less predictable since ...
3 years, 9 months ago (2017-03-03 13:29:36 UTC) #41
Tobias Tebbi
3 years, 9 months ago (2017-03-03 14:02:01 UTC) #42
Message was sent while issue was closed.
On 2017/03/03 13:29:36, Michael Achenbach wrote:
> On 2017/02/28 14:06:50, Michael Achenbach wrote:
> > Looks like we got slightly less predictable since this commit:
> >
>
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20predictable/...
> > 
> > Any idea? +ishell
> 
> Not sure who did what, but it looks somehow green again:
>
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20predictable?...

These two CLs fix the issue and the underlying problem:
https://codereview.chromium.org/2728983002/
https://codereview.chromium.org/2730753003/

One is not landed yet, but probably it vanished in the same way it appeared:
another Turbofan opcode made hash collisions sufficiently improbable again.

Powered by Google App Engine
This is Rietveld 408576698