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

Issue 10829098: Eliminate unnecessary deoptimization environments. (Closed)

Created:
8 years, 4 months ago by Florian Schneider
Modified:
8 years, 4 months ago
Reviewers:
srdjan
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Eliminate unnecessary deoptimization environments. This CL adds a CanOptimize predicate to every instruction. Before register allocation there is a simple pass over the IR to remove environments from instruction that never deoptmize. This reduces the number of uses and shortens live ranges of values resulting in better code. Committed: https://code.google.com/p/dart/source/detail?r=10115

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -5 lines) Patch
M vm/flow_graph_allocator.h View 1 chunk +3 lines, -0 lines 0 comments Download
M vm/flow_graph_allocator.cc View 2 chunks +13 lines, -0 lines 0 comments Download
M vm/flow_graph_builder.cc View 1 chunk +3 lines, -4 lines 0 comments Download
M vm/flow_graph_compiler.cc View 1 chunk +1 line, -0 lines 2 comments Download
M vm/intermediate_language.h View 58 chunks +118 lines, -1 line 4 comments Download

Messages

Total messages: 4 (0 generated)
Florian Schneider
8 years, 4 months ago (2012-07-31 15:34:52 UTC) #1
srdjan
Good idea & LGTM with comments. Please add ASSERTS in EmitNatives wherever we deoptimizen that ...
8 years, 4 months ago (2012-07-31 15:53:15 UTC) #2
srdjan
We plan to use CHA for optimization. That means that we will generate code that ...
8 years, 4 months ago (2012-07-31 19:49:28 UTC) #3
Florian Schneider
8 years, 4 months ago (2012-08-01 11:46:35 UTC) #4
Yes, the predicate has to be changed in the future once we can deoptimize at
calls.

https://chromiumcodereview.appspot.com/10829098/diff/1/vm/flow_graph_compiler.cc
File vm/flow_graph_compiler.cc (right):

https://chromiumcodereview.appspot.com/10829098/diff/1/vm/flow_graph_compiler...
vm/flow_graph_compiler.cc:204: ASSERT((pending_deoptimization_env_ != NULL) ||
!is_ssa_);
On 2012/07/31 15:53:15, srdjan wrote:
> Alternative would be to split this into two asserts and move them inside the
> if-s

Done.

https://chromiumcodereview.appspot.com/10829098/diff/1/vm/intermediate_langua...
File vm/intermediate_language.h (right):

https://chromiumcodereview.appspot.com/10829098/diff/1/vm/intermediate_langua...
vm/intermediate_language.h:150: // we assume every computation can deoptimize.
On 2012/07/31 15:53:15, srdjan wrote:
> The comment (by default we return true) does not match the implementation
> (abstract method). Change method to return true or change comment.

Done.

https://chromiumcodereview.appspot.com/10829098/diff/1/vm/intermediate_langua...
vm/intermediate_language.h:521: virtual bool CanDeoptimize() const { return
false; }
On 2012/07/31 19:49:28, srdjan wrote:
> All calls have to return true (future work).

Yes. It will have to change once we have something like that. If we accidentally
remove an environment that is needed the ASSERT in the code generator will
trigger.

Powered by Google App Engine
This is Rietveld 408576698