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

Issue 10440087: Compute liveness of instructions to get better and fewer variable names. (Closed)

Created:
8 years, 6 months ago by ngeoffray
Modified:
8 years, 6 months ago
CC:
reviews_dartlang.org, karlklose, ahe
Visibility:
Public.

Description

Compute liveness of instructions to get better and fewer variable names. Committed: https://code.google.com/p/dart/source/detail?r=8145

Patch Set 1 : #

Total comments: 105

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+746 lines, -435 lines) Patch
M frog/tests/leg/ssa_phi_codegen_test.dart View 1 1 chunk +2 lines, -6 lines 0 comments Download
M frog/tests/leg/type_guard_unuser_test.dart View 1 1 chunk +1 line, -2 lines 0 comments Download
M frog/tests/leg/type_inference_test.dart View 1 2 3 1 chunk +3 lines, -7 lines 0 comments Download
M lib/compiler/implementation/ssa/builder.dart View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 2 3 15 chunks +163 lines, -326 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen_helpers.dart View 1 3 chunks +0 lines, -93 lines 0 comments Download
M lib/compiler/implementation/ssa/ssa.dart View 1 1 chunk +1 line, -0 lines 0 comments Download
A lib/compiler/implementation/ssa/variable_allocator.dart View 1 2 3 1 chunk +572 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
ngeoffray
8 years, 6 months ago (2012-05-30 10:13:32 UTC) #1
floitsch
LGTM. https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implementation/ssa/codegen.dart File lib/compiler/implementation/ssa/codegen.dart (right): https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implementation/ssa/codegen.dart#newcode171 lib/compiler/implementation/ssa/codegen.dart:171: * Instead we declare them at the end ...
8 years, 6 months ago (2012-05-30 18:45:03 UTC) #2
kasperl
LGTM. https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implementation/ssa/codegen.dart File lib/compiler/implementation/ssa/codegen.dart (right): https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implementation/ssa/codegen.dart#newcode440 lib/compiler/implementation/ssa/codegen.dart:440: return; Maybe change the structure so that you ...
8 years, 6 months ago (2012-05-31 05:26:03 UTC) #3
ngeoffray
Thanks Kasper and Florian! http://codereview.chromium.org/10440087/diff/2001/lib/compiler/implementation/ssa/codegen.dart File lib/compiler/implementation/ssa/codegen.dart (right): http://codereview.chromium.org/10440087/diff/2001/lib/compiler/implementation/ssa/codegen.dart#newcode171 lib/compiler/implementation/ssa/codegen.dart:171: * Instead we declare them ...
8 years, 6 months ago (2012-05-31 08:12:46 UTC) #4
Lasse Reichstein Nielsen
Haven't understood it all yet, so these are mainly style comments. https://chromiumcodereview.appspot.com/10440087/diff/2001/frog/tests/leg/type_inference_test.dart File frog/tests/leg/type_inference_test.dart (right): ...
8 years, 6 months ago (2012-05-31 08:24:55 UTC) #5
ngeoffray
8 years, 6 months ago (2012-05-31 08:48:22 UTC) #6
Thanks Lasse for the comments.

https://chromiumcodereview.appspot.com/10440087/diff/2001/frog/tests/leg/type...
File frog/tests/leg/type_inference_test.dart (right):

https://chromiumcodereview.appspot.com/10440087/diff/2001/frog/tests/leg/type...
frog/tests/leg/type_inference_test.dart:71: new RegExp("sum = sum \\+ i");
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> This is completely static text, so a RegExp is overdoing it. Does String have
a
> .contains you could use, or if not, could you use .indexof(...) >= 0?

Done.

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
File lib/compiler/implementation/ssa/codegen.dart (right):

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/codegen.dart:149: final Set<String>
declaredVariables;
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> Can you add a doc-comment describing what this means (and ditto for
> delayedVariableDeclarations, so the distinction is clear)

Done.

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/codegen.dart:156: VariableNames variableNames;
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> And this one too, to explain the difference from the other ones.

Done.

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/codegen.dart:440: return;
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> Why this change?
> Where do you change the state to STATE_DECLARATION?

In declareVariable line 454. I need this change because the 'var' is not needed
when the variable following has already been declared.

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/codegen.dart:895: * Sequentialize a list of
parallel copies.
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> Describe which criteria are being used to do the ordering/sequentializing.
> "list of parallel copies" => "list of conceptually parallel copyings" (a list
is
> already sequential).
> Change "copy" to "copying" (and pluralize accordingly). A "copy" is the result
> of the act of "copying". It's the acts that you sequentialize.

Added the 'conceptually'. As discussed, kept the 'copy/copies' terminology due
to (mis-)uses in the literature.

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/codegen.dart:899: Map<String, String>
currentLocation = new Map<String, String>();
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> What is a "location" here?

It is a variable. It really is "the variable that holds the value of that
variable".

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/codegen.dart:905: List<String> todo =
<String>[];
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> "todo" -> "worklist".

Done.

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/codegen.dart:907: // List of variables that we
can assign a value to (ie are not
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> Describe which criteria are being used to do the ordering/sequentializing.
> "list of parallel copies" => "list of conceptually parallel copyings" (a list
is
> already sequential).
> Change "copy" to "copying" (and pluralize accordingly). A "copy" is the result
> of the act of "copying". It's the acts that you sequentialize. Or are they
> "assignments"?

Done.

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
File lib/compiler/implementation/ssa/variable_allocator.dart (right):

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/variable_allocator.dart:284: class Copy {
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> Rename to "Copying" (or "Assignment" if that isn't taken).
> This represents an act of copying, not the resulting copy.

As discussed, kept the name :)

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/variable_allocator.dart:302: * Trivial
assignments from a constant to the phi of a successor.
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> How is this different from a copying? I.e., what makes them trivial?

Because the source does not need a name. Added a comment.

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/variable_allocator.dart:330: static final String
SWAP_TEMP = 't0';
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> How do we know this doesn't collide with anything?
> (If we do, write it here).

Done. And added a TODO to deal with parameters.

https://chromiumcodereview.appspot.com/10440087/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/variable_allocator.dart:535:
names.addAssignment(predecessor, input, phi);
On 2012/05/31 08:24:56, Lasse Reichstein Nielsen wrote:
> If it doesn't need a variable, what are we assigning to?

The instruction (eg a constant, or a generate at use site instruction).

Powered by Google App Engine
This is Rietveld 408576698