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

Issue 10098001: Refactor type propagation. (Closed)

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

Description

Refactor type propagation. Committed: https://code.google.com/p/dart/source/detail?r=6599

Patch Set 1 #

Patch Set 2 : Fix type for null and update tests. #

Total comments: 21

Patch Set 3 : Address comments and add new test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+461 lines, -233 lines) Patch
M frog/tests/leg/leg.status View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A frog/tests/leg/src/TypeInference2Test.dart View 1 2 1 chunk +20 lines, -0 lines 0 comments Download
A frog/tests/leg/src/TypeInference3Test.dart View 1 1 chunk +19 lines, -0 lines 0 comments Download
M frog/tests/leg/src/TypeInferenceTest.dart View 1 2 1 chunk +1 line, -7 lines 0 comments Download
M lib/compiler/implementation/ssa/bailout.dart View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 1 2 33 chunks +312 lines, -185 lines 0 comments Download
M lib/compiler/implementation/ssa/optimize.dart View 1 2 8 chunks +21 lines, -14 lines 0 comments Download
M lib/compiler/implementation/ssa/tracer.dart View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/types.dart View 1 2 5 chunks +46 lines, -22 lines 0 comments Download
M tests/language/language-leg.status View 1 2 1 chunk +1 line, -2 lines 0 comments Download
A tests/language/src/ListDoubleIndexInLoop2Test.dart View 1 2 1 chunk +33 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
floitsch
8 years, 8 months ago (2012-04-16 08:51:16 UTC) #1
kasperl
LGTM! I like the new names for the types (propagated, guaranteed, likely) on the SSA ...
8 years, 8 months ago (2012-04-16 09:09:43 UTC) #2
Lasse Reichstein Nielsen
dbc https://chromiumcodereview.appspot.com/10098001/diff/2001/lib/compiler/implementation/ssa/nodes.dart File lib/compiler/implementation/ssa/nodes.dart (right): https://chromiumcodereview.appspot.com/10098001/diff/2001/lib/compiler/implementation/ssa/nodes.dart#newcode901 lib/compiler/implementation/ssa/nodes.dart:901: * This is still confusing. The propagatedType is ...
8 years, 8 months ago (2012-04-16 11:37:04 UTC) #3
floitsch
8 years, 8 months ago (2012-04-16 19:59:36 UTC) #4
https://chromiumcodereview.appspot.com/10098001/diff/2001/frog/tests/leg/leg....
File frog/tests/leg/leg.status (right):

https://chromiumcodereview.appspot.com/10098001/diff/2001/frog/tests/leg/leg....
frog/tests/leg/leg.status:8: TypeInference2Test: Fail # Requires liveness
analysis.
On 2012/04/16 09:09:43, kasperl wrote:
> File bug?

Done.

https://chromiumcodereview.appspot.com/10098001/diff/2001/frog/tests/leg/src/...
File frog/tests/leg/src/TypeInference2Test.dart (right):

https://chromiumcodereview.appspot.com/10098001/diff/2001/frog/tests/leg/src/...
frog/tests/leg/src/TypeInference2Test.dart:17: RegExp regexp = new RegExp("i =
\\(?$anyIdentifier \\+ \\(1\\)\\)?");
On 2012/04/16 09:09:43, kasperl wrote:
> Maybe add a comment that explains what you're looking for here?

Done.

https://chromiumcodereview.appspot.com/10098001/diff/2001/frog/tests/leg/src/...
File frog/tests/leg/src/TypeInferenceTest.dart (right):

https://chromiumcodereview.appspot.com/10098001/diff/2001/frog/tests/leg/src/...
frog/tests/leg/src/TypeInferenceTest.dart:53: // Some of TEST_ONE checks have
been moved into separate tests.
On 2012/04/16 09:09:43, kasperl wrote:
> I'm not sure this comment adds much value.

removed.

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

https://chromiumcodereview.appspot.com/10098001/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/nodes.dart:901: *
On 2012/04/16 11:37:04, Lasse Reichstein Nielsen wrote:
> This is still confusing.
> The propagatedType is named from how it's derived, not what it is. Then there
is
> an exception where it's not derived that way, making the name entirely wrong.
> Is there some way to name it for what it is? If it is anything meaningful, and
> not just an intermediate value for our algorithms.

Reworded the description: The propagated type is the type that the instruction
is assumed to have. If [computeType...] and [propagatedType] differ than we have
done some optimistic type assumptions which must be guarded.

https://chromiumcodereview.appspot.com/10098001/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/nodes.dart:925: // By default just copy the
guaranteed type.
On 2012/04/16 09:09:43, kasperl wrote:
> Fold this comment into the /** doc */ comment?

Done.

https://chromiumcodereview.appspot.com/10098001/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/nodes.dart:1657: if (propagatedType.isUnknown()
|| propagatedType.isNumber()) {
On 2012/04/16 09:09:43, kasperl wrote:
> Maybe we should add more documentation to the computeDesiredTypeForInput
methods
> so they contain explanations on why we choose certain desired types? Whenever
I
> read these methods, I have to think.

Added a lot of comments. I hope that's what you had in mind.

https://chromiumcodereview.appspot.com/10098001/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/nodes.dart:1786:
HConstant.internal(this.constant, HType type)
On 2012/04/16 09:09:43, kasperl wrote:
> this.constantType in the parameter list?

Done.

https://chromiumcodereview.appspot.com/10098001/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/nodes.dart:1981: if (builtin) {
On 2012/04/16 09:09:43, kasperl wrote:
> Single-line return for consistency.

Done.

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

https://chromiumcodereview.appspot.com/10098001/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/tracer.dart:169: switch
(instruction.propagatedType) {
On 2012/04/16 09:09:43, kasperl wrote:
> instruction.propagedType -> type

Done.

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

https://chromiumcodereview.appspot.com/10098001/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/types.dart:76: void
addDependentInstructionsToWorkList(HInstruction instruction) {
On 2012/04/16 09:09:43, kasperl wrote:
> Add a comment that explains why you don't need to deal with the inputs here
(and
> maybe contrast that to the SpeculativeTypePropagator implementation of the
same
> method).

Done.

Powered by Google App Engine
This is Rietveld 408576698