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

Unified Diff: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart

Issue 1526623004: cps_ir: Add JS checks, use argument nullability (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
index 63d5f86ad2f1e3ab65decdc65f359bf6a657aff9..bd392df278f2492f3d1da50bd91357a9a6a8b287 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
@@ -1144,10 +1144,7 @@ class StatementRewriter extends Transformer implements Pass {
// Some arguments will get inserted in a JS code template. The arguments
// will not always be evaluated (e.g. the second placeholder in the template
// '# && #').
-
- // TODO(sra): Find out which tree_ir expressions are not nullable. It helps
- // a lot with templates like '#.push(#)'.
- bool isNullable(e) => true;
+ bool isNullable(int position) => node.nullableArguments[position];
int safeArguments =
PlaceholderSafetyAnalysis.analyze(node.codeTemplate.ast, isNullable);
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698