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

Side by Side Diff: pkg/compiler/lib/src/js_backend/no_such_method_registry.dart

Issue 2278213003: Rename the global inference task and reduce it's API surface by introducing the (Closed)
Patch Set: cl comments Created 4 years, 3 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/js_backend/backend.dart ('k') | pkg/compiler/lib/src/ssa/builder.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 import '../common.dart'; 5 import '../common.dart';
6 import '../common/names.dart' show Identifiers, Names, Selectors; 6 import '../common/names.dart' show Identifiers, Names, Selectors;
7 import '../compiler.dart' show Compiler; 7 import '../compiler.dart' show Compiler;
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../tree/tree.dart'; 9 import '../tree/tree.dart';
10 import '../types/types.dart'; 10 import '../types/types.dart';
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 /// Returns [true] if the given element is a complex [noSuchMethod] 119 /// Returns [true] if the given element is a complex [noSuchMethod]
120 /// implementation. An implementation is complex if it falls into 120 /// implementation. An implementation is complex if it falls into
121 /// category D, as described above. 121 /// category D, as described above.
122 bool isComplex(FunctionElement element) { 122 bool isComplex(FunctionElement element) {
123 assert(element.name == Identifiers.noSuchMethod_); 123 assert(element.name == Identifiers.noSuchMethod_);
124 return otherImpls.contains(element); 124 return otherImpls.contains(element);
125 } 125 }
126 126
127 _subcategorizeOther(FunctionElement element) { 127 _subcategorizeOther(FunctionElement element) {
128 TypeMask returnType = 128 if (_compiler.globalInference.throwsAlways(element)) {
129 _compiler.typesTask.getGuaranteedReturnTypeOfElement(element);
130 if (returnType == const TypeMask.nonNullEmpty()) {
131 complexNoReturnImpls.add(element); 129 complexNoReturnImpls.add(element);
132 } else { 130 } else {
133 complexReturningImpls.add(element); 131 complexReturningImpls.add(element);
134 } 132 }
135 } 133 }
136 134
137 NsmCategory _categorizeImpl(FunctionElement element) { 135 NsmCategory _categorizeImpl(FunctionElement element) {
138 assert(element.name == Identifiers.noSuchMethod_); 136 assert(element.name == Identifiers.noSuchMethod_);
139 if (defaultImpls.contains(element)) { 137 if (defaultImpls.contains(element)) {
140 return NsmCategory.DEFAULT; 138 return NsmCategory.DEFAULT;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (body.statements.nodes.head is ExpressionStatement) { 262 if (body.statements.nodes.head is ExpressionStatement) {
265 ExpressionStatement stmt = body.statements.nodes.head; 263 ExpressionStatement stmt = body.statements.nodes.head;
266 return stmt.expression is Throw; 264 return stmt.expression is Throw;
267 } 265 }
268 } 266 }
269 return false; 267 return false;
270 } 268 }
271 } 269 }
272 270
273 enum NsmCategory { DEFAULT, THROWING, NOT_APPLICABLE, OTHER, } 271 enum NsmCategory { DEFAULT, THROWING, NOT_APPLICABLE, OTHER, }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698