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

Issue 10139012: Refactor types in ssa nodes. (Closed)

Created:
8 years, 8 months ago by floitsch
Modified:
8 years, 8 months ago
Reviewers:
ngeoffray, kasperl
CC:
reviews_dartlang.org, ngeoffray
Visibility:
Public.

Description

Refactor types in ssa nodes. Merges in CL https://chromiumcodereview.appspot.com/10161022 Fixes issue 2564. Committed: https://code.google.com/p/dart/source/detail?r=6970

Patch Set 1 #

Patch Set 2 : Update status file. #

Total comments: 26

Patch Set 3 : Address comments and remove isIntegerOrDouble. #

Total comments: 26

Patch Set 4 : Changed from type enum to type hierarchy. #

Patch Set 5 : Merge issue 10161022. #

Patch Set 6 : Fixes and rebase. #

Patch Set 7 : rebase #

Patch Set 8 : More fixes. #

Total comments: 22

Patch Set 9 : rebase. #

Patch Set 10 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+799 lines, -252 lines) Patch
M frog/tests/leg/leg.status View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
A frog/tests/leg/src/TypeCombinationTest.dart View 1 2 3 4 5 6 7 8 9 1 chunk +406 lines, -0 lines 0 comments Download
M frog/tests/leg/src/TypeInference3Test.dart View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
A frog/tests/leg/src/TypeInference4Test.dart View 1 2 3 4 5 6 7 8 9 1 chunk +27 lines, -0 lines 0 comments Download
A frog/tests/leg/src/TypeInference5Test.dart View 1 2 3 4 5 6 7 8 9 1 chunk +26 lines, -0 lines 0 comments Download
M lib/compiler/implementation/ssa/builder.dart View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 2 3 4 5 6 7 8 3 chunks +15 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 1 2 3 4 5 6 7 8 9 10 chunks +24 lines, -114 lines 0 comments Download
M lib/compiler/implementation/ssa/optimize.dart View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/ssa.dart View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M lib/compiler/implementation/ssa/tracer.dart View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/types.dart View 1 2 3 4 5 6 7 8 9 1 chunk +270 lines, -117 lines 0 comments Download
A + lib/compiler/implementation/ssa/types_propagation.dart View 1 2 3 4 5 6 7 8 9 4 chunks +14 lines, -9 lines 0 comments Download
M tests/language/language-leg.status View 1 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
floitsch
8 years, 8 months ago (2012-04-20 19:00:57 UTC) #1
kasperl
LGTM. Maybe let Nicolas take a look too? https://chromiumcodereview.appspot.com/10139012/diff/1001/frog/tests/leg/src/TypeInference4Test.dart File frog/tests/leg/src/TypeInference4Test.dart (right): https://chromiumcodereview.appspot.com/10139012/diff/1001/frog/tests/leg/src/TypeInference4Test.dart#newcode19 frog/tests/leg/src/TypeInference4Test.dart:19: print(generated); ...
8 years, 8 months ago (2012-04-23 05:48:30 UTC) #2
floitsch
Removed isIntegerOrDouble() functions. https://chromiumcodereview.appspot.com/10139012/diff/1001/frog/tests/leg/src/TypeInference4Test.dart File frog/tests/leg/src/TypeInference4Test.dart (right): https://chromiumcodereview.appspot.com/10139012/diff/1001/frog/tests/leg/src/TypeInference4Test.dart#newcode19 frog/tests/leg/src/TypeInference4Test.dart:19: print(generated); On 2012/04/23 05:48:30, kasperl wrote: ...
8 years, 8 months ago (2012-04-23 09:21:05 UTC) #3
ngeoffray
LGTM! https://chromiumcodereview.appspot.com/10139012/diff/7002/lib/compiler/implementation/ssa/nodes.dart File lib/compiler/implementation/ssa/nodes.dart (right): https://chromiumcodereview.appspot.com/10139012/diff/7002/lib/compiler/implementation/ssa/nodes.dart#newcode670 lib/compiler/implementation/ssa/nodes.dart:670: // We need a field so that the ...
8 years, 8 months ago (2012-04-23 10:19:21 UTC) #4
floitsch
PTAL. I have completely refactored again. https://chromiumcodereview.appspot.com/10139012/diff/7002/lib/compiler/implementation/ssa/nodes.dart File lib/compiler/implementation/ssa/nodes.dart (right): https://chromiumcodereview.appspot.com/10139012/diff/7002/lib/compiler/implementation/ssa/nodes.dart#newcode670 lib/compiler/implementation/ssa/nodes.dart:670: // We need ...
8 years, 8 months ago (2012-04-24 15:25:18 UTC) #5
ngeoffray
LGTM! http://codereview.chromium.org/10139012/diff/19001/frog/tests/leg/src/TypeInference4Test.dart File frog/tests/leg/src/TypeInference4Test.dart (right): http://codereview.chromium.org/10139012/diff/19001/frog/tests/leg/src/TypeInference4Test.dart#newcode20 frog/tests/leg/src/TypeInference4Test.dart:20: // Don't test for illegal argument exception. This ...
8 years, 8 months ago (2012-04-25 11:41:13 UTC) #6
floitsch
8 years, 8 months ago (2012-04-25 19:52:15 UTC) #7
https://chromiumcodereview.appspot.com/10139012/diff/19001/frog/tests/leg/src...
File frog/tests/leg/src/TypeInference4Test.dart (right):

https://chromiumcodereview.appspot.com/10139012/diff/19001/frog/tests/leg/src...
frog/tests/leg/src/TypeInference4Test.dart:20: // Don't test for illegal
argument exception. This means that the arguments
On 2012/04/25 11:41:13, ngeoffray wrote:
> Don't test -> Test

That was particularly badly worded.
done.

https://chromiumcodereview.appspot.com/10139012/diff/19001/frog/tests/leg/src...
File frog/tests/leg/src/TypeInference5Test.dart (right):

https://chromiumcodereview.appspot.com/10139012/diff/19001/frog/tests/leg/src...
frog/tests/leg/src/TypeInference5Test.dart:19: // Don't test for illegal
argument exception. This means that the arguments
On 2012/04/25 11:41:13, ngeoffray wrote:
> ditto

Done.

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
File lib/compiler/implementation/ssa/nodes.dart (right):

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
lib/compiler/implementation/ssa/nodes.dart:730: bool isIndexablePrimitive() =>
propagatedType.isIndexable();
On 2012/04/25 11:41:13, ngeoffray wrote:
> I think both should be named isIndexablePrimitive for consistency.

Done.

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
lib/compiler/implementation/ssa/nodes.dart:2044: return HType.INDEXABLE;
On 2012/04/25 11:41:13, ngeoffray wrote:
> INDEXABLE_PRIMITIVE

Done.

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
File lib/compiler/implementation/ssa/types.dart (right):

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
lib/compiler/implementation/ssa/types.dart:56: *   *
INTEGER.union(INTEGER_OR_DOUBLE) => NUMBER.
On 2012/04/25 11:41:13, ngeoffray wrote:
> INTEGER_OR_DOUBLE -> NUMBER

Done.

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
lib/compiler/implementation/ssa/types.dart:57: *   * DOUBLE.union(INTEGER) =>
DOUBLE.
On 2012/04/25 11:41:13, ngeoffray wrote:
> => NUMBER

Done.

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
lib/compiler/implementation/ssa/types.dart:66: abstract HType union(HType
other);
On 2012/04/25 11:41:13, ngeoffray wrote:
> Could you actually write unit tests for union and intersection. The code to
> implement them is not trivial (eg sometimes you return this, sometimes you
> return HType.FOO).
> 
> The tests should be trivial to write and will prevent us from making
refactoring
> bugs.

Done.

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
lib/compiler/implementation/ssa/types.dart:96: if (other.isBoolean() ||
other.isUnknown()) return this;
On 2012/04/25 11:41:13, ngeoffray wrote:
> Instead of returning [this] in these methods, I would prefer if you
explicitely
> write it (eg HType.BOOLEAN).

Done.

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
lib/compiler/implementation/ssa/types.dart:148: return super.union(other);
On 2012/04/25 11:41:13, ngeoffray wrote:
> Personal preference, but I'd prefer if you inlined the code here. Making it
rely
> on how the super is implemented looks brittle to me.

Done.

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
lib/compiler/implementation/ssa/types.dart:256: 
On 2012/04/25 11:41:13, ngeoffray wrote:
> extra space

Done.

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
File lib/compiler/implementation/ssa/types_propagation.dart (right):

https://chromiumcodereview.appspot.com/10139012/diff/19001/lib/compiler/imple...
lib/compiler/implementation/ssa/types_propagation.dart:46: if
(phi.propagatedType.isUnknown()) {
On 2012/04/25 11:41:13, ngeoffray wrote:
> Please add a comment on why the phi may already have a type.

Done.

Powered by Google App Engine
This is Rietveld 408576698