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

Issue 780403003: Remove trivial dead stores during dead code elimination (Closed)

Created:
6 years ago by sra1
Modified:
6 years ago
Reviewers:
floitsch, herhut
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Remove trivial dead stores during dead code elimination Occasionally this optimizes a StringBuffer into a local string variable. If we had targeted inlining to inline more methods on StringBuffer we would see more examples. padRight: function(source, $length) { var result, str, t1; result = new P.StringBuffer(""); str = typeof source === "string" ? source : H.S(source); result._contents = str; for (t1 = str; t1.length < $length;) { t1 += " "; result._contents = t1; } return t1.charCodeAt(0) == 0 ? t1 : t1; }, --> padRight: function(source, $length) { var str, t1; str = typeof source === "string" ? source : H.S(source); for (t1 = str; t1.length < $length;) t1 += " "; return t1.charCodeAt(0) == 0 ? t1 : t1; }, R=floitsch@google.com Committed: https://code.google.com/p/dart/source/detail?r=42302

Patch Set 1 : #

Total comments: 4

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -0 lines) Patch
M pkg/compiler/lib/src/ssa/optimize.dart View 1 2 chunks +28 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
sra1
6 years ago (2014-12-09 23:35:46 UTC) #3
sra1
Ping. In combination with https://chromiumcodereview.appspot.com/790013002/ Uri.toString is improved: toString$0: function(_) { var sb, t1, t2, ...
6 years ago (2014-12-10 18:23:54 UTC) #4
sra1
6 years ago (2014-12-10 20:09:16 UTC) #6
floitsch
LGTM. https://chromiumcodereview.appspot.com/780403003/diff/20001/pkg/compiler/lib/src/ssa/optimize.dart File pkg/compiler/lib/src/ssa/optimize.dart (right): https://chromiumcodereview.appspot.com/780403003/diff/20001/pkg/compiler/lib/src/ssa/optimize.dart#newcode985 pkg/compiler/lib/src/ssa/optimize.dart:985: Map<HInstruction, bool> trivialDeadStoreReceivers = <HInstruction, bool>{}; Do you ...
6 years ago (2014-12-10 20:33:05 UTC) #7
sra1
6 years ago (2014-12-10 23:08:48 UTC) #8
https://chromiumcodereview.appspot.com/780403003/diff/20001/pkg/compiler/lib/...
File pkg/compiler/lib/src/ssa/optimize.dart (right):

https://chromiumcodereview.appspot.com/780403003/diff/20001/pkg/compiler/lib/...
pkg/compiler/lib/src/ssa/optimize.dart:985: Map<HInstruction, bool>
trivialDeadStoreReceivers = <HInstruction, bool>{};
On 2014/12/10 20:33:04, floitsch wrote:
> Do you think a Map is warranted?
> maybe just a maplet?

Done.

https://chromiumcodereview.appspot.com/780403003/diff/20001/pkg/compiler/lib/...
pkg/compiler/lib/src/ssa/optimize.dart:1032: // The use must be the receiver. 
If the use is also the argument, i.e.
On 2014/12/10 20:33:04, floitsch wrote:
> Even if the use...

Done.

Powered by Google App Engine
This is Rietveld 408576698