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

Issue 949743002: [turbofan] Variable liveness analysis for deopt (Closed)

Created:
5 years, 10 months ago by Jarin
Modified:
5 years, 9 months ago
CC:
v8-dev, titzer
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[turbofan] Variable liveness analysis for deopt. This change introduces a liveness analyzer for local variables in frame states. The main idea is to use the AstGraphBuilder::Environment class to build the control flow graph, and record local variable loads, stores and checkpoints in the CFG basic blocks (LivenessAnalyzerBlock class). After the graph building finishes, we run a simple data flow analysis over the CFG to figure out liveness of each local variable at each checkpoint. Finally, we run a pass over all the checkpoints and replace dead local variables in the frame states with the 'undefined' value. Performance numbers for Embenchen are below. ----------- box2d.js Current --turbo-deoptimization: EmbenchenBox2d(RunTime): 11265 ms. d8-master --turbo-deoptimization: EmbenchenBox2d(RunTime): 11768 ms. d8-master: EmbenchenBox2d(RunTime): 10996 ms. ----------- bullet.js Current --turbo-deoptimization: EmbenchenBullet(RunTime): 17049 ms. d8-master --turbo-deoptimization: EmbenchenBullet(RunTime): 17384 ms. d8-master: EmbenchenBullet(RunTime): 16153 ms. ----------- copy.js Current --turbo-deoptimization: EmbenchenCopy(RunTime): 4877 ms. d8-master --turbo-deoptimization: EmbenchenCopy(RunTime): 4938 ms. d8-master: EmbenchenCopy(RunTime): 4940 ms. ----------- corrections.js Current --turbo-deoptimization: EmbenchenCorrections(RunTime): 7068 ms. d8-master --turbo-deoptimization: EmbenchenCorrections(RunTime): 6718 ms. d8-master: EmbenchenCorrections(RunTime): 6858 ms. ----------- fannkuch.js Current --turbo-deoptimization: EmbenchenFannkuch(RunTime): 4167 ms. d8-master --turbo-deoptimization: EmbenchenFannkuch(RunTime): 4608 ms. d8-master: EmbenchenFannkuch(RunTime): 4149 ms. ----------- fasta.js Current --turbo-deoptimization: EmbenchenFasta(RunTime): 9981 ms. d8-master --turbo-deoptimization: EmbenchenFasta(RunTime): 9848 ms. d8-master: EmbenchenFasta(RunTime): 9640 ms. ----------- lua_binarytrees.js Current --turbo-deoptimization: EmbenchenLuaBinaryTrees(RunTime): 11571 ms. d8-master --turbo-deoptimization: EmbenchenLuaBinaryTrees(RunTime): 13089 ms. d8-master: EmbenchenLuaBinaryTrees(RunTime): 10957 ms. ----------- memops.js Current --turbo-deoptimization: EmbenchenMemOps(RunTime): 7766 ms. d8-master --turbo-deoptimization: EmbenchenMemOps(RunTime): 7346 ms. d8-master: EmbenchenMemOps(RunTime): 7738 ms. ----------- primes.js Current --turbo-deoptimization: EmbenchenPrimes(RunTime): 7459 ms. d8-master --turbo-deoptimization: EmbenchenPrimes(RunTime): 7453 ms. d8-master: EmbenchenPrimes(RunTime): 7451 ms. ----------- skinning.js Current --turbo-deoptimization: EmbenchenSkinning(RunTime): 15564 ms. d8-master --turbo-deoptimization: EmbenchenSkinning(RunTime): 15611 ms. d8-master: EmbenchenSkinning(RunTime): 15583 ms. ----------- zlib.js Current --turbo-deoptimization: EmbenchenZLib(RunTime): 10825 ms. d8-master --turbo-deoptimization: EmbenchenZLib(RunTime): 11180 ms. d8-master: EmbenchenZLib(RunTime): 10823 ms. BUG= Committed: https://crrev.com/ca3abde2fad3af0c84fc368e111149e966727dde Cr-Commit-Position: refs/heads/master@{#27232}

Patch Set 1 #

Patch Set 2 : Fixes, tests #

Patch Set 3 : Put printing under a flag #

Patch Set 4 : Rebase #

Patch Set 5 : Tweaks #

Patch Set 6 : Bind/Lookup diamond test #

Patch Set 7 : Towards making win64 happy #

Patch Set 8 : Compile error fix - part II #

Patch Set 9 : Test tweaks #

Total comments: 15

Patch Set 10 : Address review comments #

Patch Set 11 : Rebase to use state values cache #

Patch Set 12 : Obligatory attempt at Win64 happiness #

Patch Set 13 : Win64 fix part II #

Total comments: 13

Patch Set 14 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+857 lines, -28 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M src/compiler/ast-graph-builder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +18 lines, -22 lines 0 comments Download
M src/compiler/ast-graph-builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 11 chunks +108 lines, -6 lines 0 comments Download
A src/compiler/liveness-analyzer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +146 lines, -0 lines 0 comments Download
A src/compiler/liveness-analyzer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +200 lines, -0 lines 0 comments Download
M src/compiler/state-values-utils.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
A test/unittests/compiler/liveness-analyzer-unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +373 lines, -0 lines 0 comments Download
M test/unittests/unittests.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
Jarin
On 2015/02/25 09:33:04, jarin wrote: > mailto:jarin@chromium.org changed reviewers: > + mailto:mstarzinger@chromium.org Michael, could you ...
5 years, 9 months ago (2015-02-25 09:35:42 UTC) #3
titzer
https://codereview.chromium.org/949743002/diff/130001/src/compiler/liveness-analyzer.h File src/compiler/liveness-analyzer.h (right): https://codereview.chromium.org/949743002/diff/130001/src/compiler/liveness-analyzer.h#newcode21 src/compiler/liveness-analyzer.h:21: void RelaxFrameState(Node* frame_state, ZoneVector<bool>* liveness); Can we use a ...
5 years, 9 months ago (2015-02-27 21:03:54 UTC) #5
titzer
Looks good, pretty clean. Mostly just naming nits. https://codereview.chromium.org/949743002/diff/130001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/949743002/diff/130001/src/compiler/ast-graph-builder.cc#newcode548 src/compiler/ast-graph-builder.cc:548: relaxer.Blacklist(arguments->index()); ...
5 years, 9 months ago (2015-02-27 21:09:55 UTC) #6
Michael Starzinger
I don't have any more constructive feedback on this CL. Please choose another reviewer to ...
5 years, 9 months ago (2015-03-01 21:00:56 UTC) #7
Michael Starzinger
A coupla' nits. https://codereview.chromium.org/949743002/diff/130001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/949743002/diff/130001/src/compiler/ast-graph-builder.cc#newcode674 src/compiler/ast-graph-builder.cc:674: AstGraphBuilder::Environment* AstGraphBuilder::Environment::Snapshot() { nit: How about ...
5 years, 9 months ago (2015-03-02 10:56:34 UTC) #8
Jarin
Benedikt, could you take another look? I have rebased this to use the state values ...
5 years, 9 months ago (2015-03-16 21:30:12 UTC) #9
Benedikt Meurer
https://codereview.chromium.org/949743002/diff/210001/src/compiler/ast-graph-builder.h File src/compiler/ast-graph-builder.h (right): https://codereview.chromium.org/949743002/diff/210001/src/compiler/ast-graph-builder.h#newcode107 src/compiler/ast-graph-builder.h:107: LivenessAnalyzer* liveness_analyzer_; Chromium style guide nit again: Don't turn ...
5 years, 9 months ago (2015-03-17 05:12:03 UTC) #10
Jarin
All done. Thanks! https://codereview.chromium.org/949743002/diff/210001/src/compiler/ast-graph-builder.h File src/compiler/ast-graph-builder.h (right): https://codereview.chromium.org/949743002/diff/210001/src/compiler/ast-graph-builder.h#newcode107 src/compiler/ast-graph-builder.h:107: LivenessAnalyzer* liveness_analyzer_; On 2015/03/17 05:12:03, Benedikt ...
5 years, 9 months ago (2015-03-17 09:22:57 UTC) #11
Benedikt Meurer
lgtm
5 years, 9 months ago (2015-03-17 09:29:29 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/949743002/230001
5 years, 9 months ago (2015-03-17 09:34:09 UTC) #14
commit-bot: I haz the power
Committed patchset #14 (id:230001)
5 years, 9 months ago (2015-03-17 09:38:42 UTC) #15
commit-bot: I haz the power
5 years, 9 months ago (2015-03-17 09:38:50 UTC) #16
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/ca3abde2fad3af0c84fc368e111149e966727dde
Cr-Commit-Position: refs/heads/master@{#27232}

Powered by Google App Engine
This is Rietveld 408576698