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

Issue 10831070: Allow deoptimization from states with spilled values. (Closed)

Created:
8 years, 4 months ago by Vyacheslav Egorov (Google)
Modified:
8 years, 4 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Revert instruction numbering scheme to an instruction start (2*k) - instruction end (2*k + 1) one. Current instruction numbering scheme does not capture interference between temporaries and inputs correctly which in rare cases causes allocation of the same register both to the temp and to the input register. Allow live range splitting at every position. Don't reuse phi-resolution parallel move for connecting live ranges or meeting register constraints, this might cause conflicts between moves. Allow deoptimization with environments containing spilled values. R=kmillikin@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=10050

Patch Set 1 #

Patch Set 2 : refactor numbering scheme #

Total comments: 5

Patch Set 3 : address Srdjan's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -80 lines) Patch
M runtime/vm/flow_graph_allocator.h View 1 2 2 chunks +12 lines, -6 lines 0 comments Download
M runtime/vm/flow_graph_allocator.cc View 1 2 26 chunks +93 lines, -68 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Vyacheslav Egorov (Google)
8 years, 4 months ago (2012-07-30 11:33:12 UTC) #1
Kevin Millikin (Google)
lgtm
8 years, 4 months ago (2012-07-30 11:34:40 UTC) #2
Vyacheslav Egorov (Google)
+srdjan Running tests with increased coverage revealed a couple of bugs in the register allocator. ...
8 years, 4 months ago (2012-07-31 00:03:14 UTC) #3
srdjan
LGTM with comments https://chromiumcodereview.appspot.com/10831070/diff/4/runtime/vm/flow_graph_allocator.cc File runtime/vm/flow_graph_allocator.cc (right): https://chromiumcodereview.appspot.com/10831070/diff/4/runtime/vm/flow_graph_allocator.cc#newcode900 runtime/vm/flow_graph_allocator.cc:900: CreateParallelMoveBefore(last, last->lifetime_position()); indent 4 spaces https://chromiumcodereview.appspot.com/10831070/diff/4/runtime/vm/flow_graph_allocator.cc#newcode917 ...
8 years, 4 months ago (2012-07-31 00:18:11 UTC) #4
srdjan
LGTM with comments https://chromiumcodereview.appspot.com/10831070/diff/4/runtime/vm/flow_graph_allocator.cc File runtime/vm/flow_graph_allocator.cc (right): https://chromiumcodereview.appspot.com/10831070/diff/4/runtime/vm/flow_graph_allocator.cc#newcode900 runtime/vm/flow_graph_allocator.cc:900: CreateParallelMoveBefore(last, last->lifetime_position()); indent 4 spaces https://chromiumcodereview.appspot.com/10831070/diff/4/runtime/vm/flow_graph_allocator.cc#newcode917 ...
8 years, 4 months ago (2012-07-31 00:18:12 UTC) #5
Vyacheslav Egorov (Google)
8 years, 4 months ago (2012-07-31 11:17:07 UTC) #6
Thanks. Landing.

https://chromiumcodereview.appspot.com/10831070/diff/4/runtime/vm/flow_graph_...
File runtime/vm/flow_graph_allocator.cc (right):

https://chromiumcodereview.appspot.com/10831070/diff/4/runtime/vm/flow_graph_...
runtime/vm/flow_graph_allocator.cc:917: instructions_[last->lifetime_position()
/ 2] = move;
On 2012/07/31 00:18:15, srdjan wrote:
> Add assert that instructions_[last->lifetime_position() / 2] is Goto
> instruction.
> 
> This code looks a little bit fragile to me. Would it be better to have Goto
> refer to move and the logic of replacing would be in AddMoveAt?

Assertion added. 

I agree the code is a little bit fragile. But the problem with moving logic to
AddMoveAt is that there is no easy way to distinguish ParallelMove created for
phi-resolution from normal parallel move added by AddMoveAt.

I'll leave it like this for now, maybe later we can come up with a different
solution, e.g. I am thinking if we can just hind parallel move for
phi-resolution into Goto instruction itself.

https://chromiumcodereview.appspot.com/10831070/diff/4/runtime/vm/flow_graph_...
File runtime/vm/flow_graph_allocator.h (right):

https://chromiumcodereview.appspot.com/10831070/diff/4/runtime/vm/flow_graph_...
runtime/vm/flow_graph_allocator.h:61: // end position we can distinguish between
instructions that need value
On 2012/07/31 00:18:15, srdjan wrote:
> Fix comment: "..by placing a use at the start or end the end position.."

Done.

Powered by Google App Engine
This is Rietveld 408576698