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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/insert_refinements.dart

Issue 1560433003: dart2js cps: Fix some analyzer hints in the CPS backend. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 4 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/inline.dart ('k') | pkg/compiler/lib/src/cps_ir/loop_effects.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library cps_ir.optimization.insert_refinements; 5 library cps_ir.optimization.insert_refinements;
6 6
7 import 'optimizers.dart' show Pass; 7 import 'optimizers.dart' show Pass;
8 import 'cps_ir_nodes.dart'; 8 import 'cps_ir_nodes.dart';
9 import '../common/names.dart'; 9 import '../common/names.dart';
10 import '../types/types.dart' show TypeMask; 10 import '../types/types.dart' show TypeMask;
11 import 'type_mask_system.dart'; 11 import 'type_mask_system.dart';
12 import 'cps_fragment.dart';
13 12
14 /// Inserts [Refinement] nodes in the IR to allow for sparse path-sensitive 13 /// Inserts [Refinement] nodes in the IR to allow for sparse path-sensitive
15 /// type analysis in the [TypePropagator] pass. 14 /// type analysis in the [TypePropagator] pass.
16 /// 15 ///
17 /// Refinement nodes are inserted at the arms of a [Branch] node with a 16 /// Refinement nodes are inserted at the arms of a [Branch] node with a
18 /// condition of form `x is T` or `x == null`. 17 /// condition of form `x is T` or `x == null`.
19 /// 18 ///
20 /// Refinement nodes are inserted after a method invocation to refine the 19 /// Refinement nodes are inserted after a method invocation to refine the
21 /// receiver to the types that can respond to the given selector. 20 /// receiver to the types that can respond to the given selector.
22 class InsertRefinements extends TrampolineRecursiveVisitor implements Pass { 21 class InsertRefinements extends TrampolineRecursiveVisitor implements Pass {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 Expression traverseLetCont(LetCont node) { 226 Expression traverseLetCont(LetCont node) {
228 for (Continuation cont in node.continuations) { 227 for (Continuation cont in node.continuations) {
229 // Do not push the branch continuations here. visitBranch will do that. 228 // Do not push the branch continuations here. visitBranch will do that.
230 if (!(cont.hasExactlyOneUse && cont.firstRef.parent is Branch)) { 229 if (!(cont.hasExactlyOneUse && cont.firstRef.parent is Branch)) {
231 push(cont); 230 push(cont);
232 } 231 }
233 } 232 }
234 return node.body; 233 return node.body;
235 } 234 }
236 } 235 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/inline.dart ('k') | pkg/compiler/lib/src/cps_ir/loop_effects.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698