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

Issue 1751963002: refactor/simplify nullable inference code (Closed)

Created:
4 years, 9 months ago by Jennifer Messerly
Modified:
4 years, 9 months ago
Reviewers:
vsm, ochafik
CC:
dev-compiler+reviews_dartlang.org
Base URL:
git@github.com:dart-lang/dev_compiler.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

refactor/simplify nullable inference code Some of the high level changes are: * visit catch body, fixes #463 * handle temps created by the compiler. These were in some cases treated incorrectly as non-null (see tests diff) * compute nullable in the same pass as visiting assignments * simplify visiting += and ++, fix ++ (it was dead code, #463) * simplify _isNullable * if we fail to see a variable declaration, treat it as nullable * stack trace in catch is treated as non-null R=vsm@google.com Committed: https://github.com/dart-lang/dev_compiler/commit/507d3c541ae56afe4a5ad0f2304b3002981bb228

Patch Set 1 #

Patch Set 2 : #

Total comments: 9

Patch Set 3 : revert tool/build_sdk #

Total comments: 7

Patch Set 4 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+312 lines, -367 lines) Patch
M lib/runtime/dart/collection.js View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
D lib/src/codegen/assignments_index.dart View 1 chunk +0 lines, -145 lines 0 comments Download
M lib/src/codegen/js_codegen.dart View 1 2 3 15 chunks +31 lines, -25 lines 0 comments Download
D lib/src/codegen/nullability_inferrer.dart View 1 chunk +0 lines, -164 lines 0 comments Download
A lib/src/codegen/nullable_type_inference.dart View 1 2 3 1 chunk +269 lines, -0 lines 2 comments Download
M lib/src/codegen/side_effect_analysis.dart View 2 chunks +5 lines, -5 lines 0 comments Download
M lib/src/utils.dart View 1 3 chunks +3 lines, -25 lines 0 comments Download
M pubspec.yaml View 1 chunk +1 line, -0 lines 0 comments Download
M test/codegen/expect/language-all.js View Binary file 0 comments Download

Messages

Total messages: 16 (5 generated)
Jennifer Messerly
https://codereview.chromium.org/1751963002/diff/20001/lib/src/codegen/nullable_type_inference.dart File lib/src/codegen/nullable_type_inference.dart (right): https://codereview.chromium.org/1751963002/diff/20001/lib/src/codegen/nullable_type_inference.dart#newcode48 lib/src/codegen/nullable_type_inference.dart:48: bool _isNullable(Expression expr, the diff didn't pick this up ...
4 years, 9 months ago (2016-03-01 22:05:41 UTC) #5
ochafik
Sweet, thanks John! Can't see the language-all diff, could you add some fixed problematic cases ...
4 years, 9 months ago (2016-03-01 23:29:57 UTC) #6
Jennifer Messerly
On 2016/03/01 23:29:57, ochafik wrote: > Sweet, thanks John! > > Can't see the language-all ...
4 years, 9 months ago (2016-03-01 23:37:48 UTC) #7
Jennifer Messerly
On 2016/03/01 23:37:48, John Messerly wrote: > On 2016/03/01 23:29:57, ochafik wrote: > > Sweet, ...
4 years, 9 months ago (2016-03-01 23:37:56 UTC) #8
ochafik
Cool, thanks! https://codereview.chromium.org/1751963002/diff/40001/lib/src/codegen/nullable_type_inference.dart File lib/src/codegen/nullable_type_inference.dart (right): https://codereview.chromium.org/1751963002/diff/40001/lib/src/codegen/nullable_type_inference.dart#newcode259 lib/src/codegen/nullable_type_inference.dart:259: if (_nullInference._isNullable(right, visitLocal)) { btw, what happens ...
4 years, 9 months ago (2016-03-01 23:44:26 UTC) #9
vsm
lgtm https://codereview.chromium.org/1751963002/diff/20001/lib/src/codegen/nullable_type_inference.dart File lib/src/codegen/nullable_type_inference.dart (right): https://codereview.chromium.org/1751963002/diff/20001/lib/src/codegen/nullable_type_inference.dart#newcode79 lib/src/codegen/nullable_type_inference.dart:79: return _isNullable(expr.target, localIsNullable); Could take advantage of the ...
4 years, 9 months ago (2016-03-01 23:57:23 UTC) #10
Jennifer Messerly
Thanks guys! I've got a few small tweaks that will make a bunch more Exprs ...
4 years, 9 months ago (2016-03-02 00:42:23 UTC) #11
Jennifer Messerly
Committed patchset #4 (id:60001) manually as 507d3c541ae56afe4a5ad0f2304b3002981bb228 (presubmit successful).
4 years, 9 months ago (2016-03-02 00:44:11 UTC) #13
ochafik
lgtm
4 years, 9 months ago (2016-03-02 02:01:15 UTC) #14
vsm
https://codereview.chromium.org/1751963002/diff/60001/lib/src/codegen/nullable_type_inference.dart File lib/src/codegen/nullable_type_inference.dart (right): https://codereview.chromium.org/1751963002/diff/60001/lib/src/codegen/nullable_type_inference.dart#newcode78 lib/src/codegen/nullable_type_inference.dart:78: if (expr is CascadeExpression) return false; This would need ...
4 years, 9 months ago (2016-03-02 14:20:33 UTC) #15
Jennifer Messerly
4 years, 9 months ago (2016-03-02 17:10:54 UTC) #16
Message was sent while issue was closed.
https://codereview.chromium.org/1751963002/diff/60001/lib/src/codegen/nullabl...
File lib/src/codegen/nullable_type_inference.dart (right):

https://codereview.chromium.org/1751963002/diff/60001/lib/src/codegen/nullabl...
lib/src/codegen/nullable_type_inference.dart:78: if (expr is CascadeExpression)
return false;
On 2016/03/02 14:20:33, vsm wrote:
> This would need to check for members supported by null.  E.g., x..toString()
is
> nullable.

Ah right. I just took your suggestion directly, didn't really think about it.
I'll add a note to my other nullable CL. :)

Powered by Google App Engine
This is Rietveld 408576698