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

Issue 2587133002: VM: [DBC] Fix lazy deoptimization after calls that return no values. (Closed)

Created:
4 years ago by Vyacheslav Egorov (Google)
Modified:
4 years ago
Reviewers:
zra, Florian Schneider
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Cutch
Target Ref:
refs/heads/master
Visibility:
Public.

Description

VM: [DBC] Fix lazy deoptimization after calls that return no values. On DBC calls return value on the stack instead of a dedicate register but not all calls have a return value (e.g. CheckStack does not) and such calls don't push anything. Implementation of a lazy deopt however assumed that value is always present and tried to manually preserve it by popping and pushing it back after the frame was rewritten. This of course damaged the frame if we performed a lazy deoptimization after the call that did not push anything. Instead of manually preserving result value value use frame translation to handle it. This allows to handle calls that return value and those that do not uniformly in the Deopt bytecode. Compiler takes care of creating the right deoptimization environment instead. BUG= R=zra@google.com Committed: https://github.com/dart-lang/sdk/commit/1fcc7384aa28aa2ca17b8ec304dd2c4e083c36cd

Patch Set 1 #

Total comments: 2

Patch Set 2 : remove static #

Patch Set 3 : Turn one test into a reload test #

Patch Set 4 : Add test #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+112 lines, -53 lines) Patch
M runtime/vm/deopt_instructions.cc View 1 chunk +7 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler.h View 5 chunks +25 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 2 chunks +2 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler_dbc.cc View 1 5 chunks +15 lines, -4 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/intermediate_language_dbc.cc View 10 chunks +11 lines, -11 lines 0 comments Download
M runtime/vm/simulator_dbc.cc View 4 chunks +10 lines, -31 lines 0 comments Download
A tests/language/vm/lazy_deopt_vm_test.dart View 1 2 3 1 chunk +39 lines, -0 lines 2 comments Download

Messages

Total messages: 8 (2 generated)
Vyacheslav Egorov (Google)
Please take a look. This brings us down to 12 failures on the dbc + ...
4 years ago (2016-12-19 19:09:22 UTC) #2
zra
If it's easy to write a regression test for this, we should probably have one. ...
4 years ago (2016-12-19 19:15:18 UTC) #3
Vyacheslav Egorov (Google)
Added a test https://codereview.chromium.org/2587133002/diff/1/runtime/vm/flow_graph_compiler_dbc.cc File runtime/vm/flow_graph_compiler_dbc.cc (right): https://codereview.chromium.org/2587133002/diff/1/runtime/vm/flow_graph_compiler_dbc.cc#newcode275 runtime/vm/flow_graph_compiler_dbc.cc:275: static const intptr_t kArgCount = 0; ...
4 years ago (2016-12-19 21:55:19 UTC) #4
zra
lgtm
4 years ago (2016-12-19 21:56:57 UTC) #5
Vyacheslav Egorov (Google)
Committed patchset #4 (id:60001) manually as 1fcc7384aa28aa2ca17b8ec304dd2c4e083c36cd (presubmit successful).
4 years ago (2016-12-19 22:08:31 UTC) #7
Florian Schneider
4 years ago (2016-12-20 00:01:08 UTC) #8
Message was sent while issue was closed.
Lgtm.

https://codereview.chromium.org/2587133002/diff/60001/tests/language/vm/lazy_...
File tests/language/vm/lazy_deopt_vm_test.dart (right):

https://codereview.chromium.org/2587133002/diff/60001/tests/language/vm/lazy_...
tests/language/vm/lazy_deopt_vm_test.dart:4: // Test deoptimization on an
optimistically hoisted smi check.
Comment not matching here.

https://codereview.chromium.org/2587133002/diff/60001/tests/language/vm/lazy_...
tests/language/vm/lazy_deopt_vm_test.dart:5: // VMOptions=--deoptimize_every=10
--optimization-counter-threshold=10  --no-background-compilation
--enable-inlining-annotations
Left-over flag? I don't see inlining annotations here.

Powered by Google App Engine
This is Rietveld 408576698