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

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

Issue 1761903002: dart2js cps: Keep interceptors in a separate field. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 4 years, 9 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 | « no previous file | pkg/compiler/lib/src/cps_ir/bounds_checker.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 library dart2js.cps_ir.backward_null_check_remover; 1 library dart2js.cps_ir.backward_null_check_remover;
2 2
3 import 'cps_ir_nodes.dart'; 3 import 'cps_ir_nodes.dart';
4 import 'optimizers.dart'; 4 import 'optimizers.dart';
5 import '../common/names.dart'; 5 import '../common/names.dart';
6 import '../universe/selector.dart'; 6 import '../universe/selector.dart';
7 import 'type_mask_system.dart'; 7 import 'type_mask_system.dart';
8 import 'cps_fragment.dart'; 8 import 'cps_fragment.dart';
9 9
10 /// Removes null checks that are follwed by another instruction that will 10 /// Removes null checks that are follwed by another instruction that will
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 /// Returns an operand of [prim] that throws if null is passed into it. 53 /// Returns an operand of [prim] that throws if null is passed into it.
54 Primitive getNullCheckedOperand(Primitive prim) { 54 Primitive getNullCheckedOperand(Primitive prim) {
55 if (prim is ReceiverCheck) return prim.value; 55 if (prim is ReceiverCheck) return prim.value;
56 if (prim is GetLength) return prim.object; 56 if (prim is GetLength) return prim.object;
57 if (prim is GetField) return prim.object; 57 if (prim is GetField) return prim.object;
58 if (prim is GetIndex) return prim.object; 58 if (prim is GetIndex) return prim.object;
59 if (prim is SetField) return prim.object; 59 if (prim is SetField) return prim.object;
60 if (prim is SetIndex) return prim.object; 60 if (prim is SetIndex) return prim.object;
61 if (prim is InvokeMethod && !selectorsOnNull.contains(prim.selector)) { 61 if (prim is InvokeMethod && !selectorsOnNull.contains(prim.selector)) {
62 return prim.dartReceiver; 62 return prim.receiver;
63 } 63 }
64 if (prim is ForeignCode) { 64 if (prim is ForeignCode) {
65 return prim.isNullGuardOnNullFirstArgument() ? prim.argument(0) : null; 65 return prim.isNullGuardOnNullFirstArgument() ? prim.argument(0) : null;
66 } 66 }
67 return null; 67 return null;
68 } 68 }
69 69
70 /// It has been determined that the null check in [prim] made redundant by 70 /// It has been determined that the null check in [prim] made redundant by
71 /// [newNullCheck]. Eliminate [prim] if it is not needed any more. 71 /// [newNullCheck]. Eliminate [prim] if it is not needed any more.
72 void tryEliminateRedundantNullCheck(Primitive prim, Primitive newNullCheck) { 72 void tryEliminateRedundantNullCheck(Primitive prim, Primitive newNullCheck) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void visitLetHandler(LetHandler node) { 119 void visitLetHandler(LetHandler node) {
120 nullCheckedValue = null; 120 nullCheckedValue = null;
121 } 121 }
122 122
123 visitInvokeContinuation(InvokeContinuation node) { 123 visitInvokeContinuation(InvokeContinuation node) {
124 if (!node.isRecursive) { 124 if (!node.isRecursive) {
125 nullCheckedValue = nullCheckedValueAt[node.continuation]; 125 nullCheckedValue = nullCheckedValueAt[node.continuation];
126 } 126 }
127 } 127 }
128 } 128 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/bounds_checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698