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

Side by Side Diff: pkg/compiler/lib/src/universe/selector.dart

Issue 2809603002: Introduce ParameterStructure (Closed)
Patch Set: Fix. Created 3 years, 8 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/universe/call_structure.dart ('k') | no next file » | 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 dart2js.selector; 5 library dart2js.selector;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart' show Names; 8 import '../common/names.dart' show Names;
9 import '../elements/elements.dart' 9 import '../elements/elements.dart'
10 show 10 show
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 return isSetter 236 return isSetter
237 ? !element.isFinal && !element.isConst 237 ? !element.isFinal && !element.isConst
238 : isGetter || isCall; 238 : isGetter || isCall;
239 } 239 }
240 if (isGetter) return true; 240 if (isGetter) return true;
241 if (isSetter) return false; 241 if (isSetter) return false;
242 return signatureApplies(element); 242 return signatureApplies(element);
243 } 243 }
244 244
245 bool signatureApplies(MethodElement function) { 245 bool signatureApplies(MethodElement function) {
246 if (Elements.isUnresolved(function)) return false; 246 return callStructure.signatureApplies(function.parameterStructure);
247 return callStructure.signatureApplies(function.type);
248 } 247 }
249 248
250 bool applies(MemberElement element) { 249 bool applies(MemberElement element) {
251 if (name != element.name) return false; 250 if (name != element.name) return false;
252 return appliesUnnamed(element); 251 return appliesUnnamed(element);
253 } 252 }
254 253
255 bool match(SelectorKind kind, Name memberName, CallStructure callStructure) { 254 bool match(SelectorKind kind, Name memberName, CallStructure callStructure) {
256 return this.kind == kind && 255 return this.kind == kind &&
257 this.memberName == memberName && 256 this.memberName == memberName &&
258 this.callStructure.match(callStructure); 257 this.callStructure.match(callStructure);
259 } 258 }
260 259
261 static int computeHashCode( 260 static int computeHashCode(
262 SelectorKind kind, Name name, CallStructure callStructure) { 261 SelectorKind kind, Name name, CallStructure callStructure) {
263 // Add bits from name and kind. 262 // Add bits from name and kind.
264 int hash = Hashing.mixHashCodeBits(name.hashCode, kind.hashCode); 263 int hash = Hashing.mixHashCodeBits(name.hashCode, kind.hashCode);
265 // Add bits from the call structure. 264 // Add bits from the call structure.
266 return Hashing.mixHashCodeBits(hash, callStructure.hashCode); 265 return Hashing.mixHashCodeBits(hash, callStructure.hashCode);
267 } 266 }
268 267
269 String toString() { 268 String toString() {
270 return 'Selector($kind, $name, ${callStructure.structureToString()})'; 269 return 'Selector($kind, $name, ${callStructure.structureToString()})';
271 } 270 }
272 271
273 Selector toCallSelector() => new Selector.callClosureFrom(this); 272 Selector toCallSelector() => new Selector.callClosureFrom(this);
274 } 273 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/universe/call_structure.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698