OLD | NEW |
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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
6 | 6 |
7 class ParameterStubGenerator { | 7 class ParameterStubGenerator { |
8 static final Set<Selector> emptySelectorSet = new Set<Selector>(); | 8 static final Set<Selector> emptySelectorSet = new Set<Selector>(); |
9 | 9 |
10 final Namer namer; | 10 final Namer namer; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // For example, for the call-selector `call(x, y)` the renamed selector | 236 // For example, for the call-selector `call(x, y)` the renamed selector |
237 // for member `foo` would be `foo(x, y)`. | 237 // for member `foo` would be `foo(x, y)`. |
238 Set<Selector> renamedCallSelectors = | 238 Set<Selector> renamedCallSelectors = |
239 callSelectors.isEmpty ? emptySelectorSet : new Set<Selector>(); | 239 callSelectors.isEmpty ? emptySelectorSet : new Set<Selector>(); |
240 | 240 |
241 Set<Selector> untypedSelectors = new Set<Selector>(); | 241 Set<Selector> untypedSelectors = new Set<Selector>(); |
242 | 242 |
243 // Start with the callSelectors since they imply the generation of the | 243 // Start with the callSelectors since they imply the generation of the |
244 // non-call version. | 244 // non-call version. |
245 for (Selector selector in callSelectors.keys) { | 245 for (Selector selector in callSelectors.keys) { |
246 Selector renamedSelector = new Selector( | 246 Selector renamedSelector = new Selector.call( |
247 SelectorKind.CALL, | |
248 member.memberName, | 247 member.memberName, |
249 selector.callStructure); | 248 selector.callStructure); |
250 renamedCallSelectors.add(renamedSelector); | 249 renamedCallSelectors.add(renamedSelector); |
251 | 250 |
252 if (!renamedSelector.appliesUnnamed(member, compiler.world)) continue; | 251 if (!renamedSelector.appliesUnnamed(member, compiler.world)) continue; |
253 | 252 |
254 if (untypedSelectors.add(renamedSelector)) { | 253 if (untypedSelectors.add(renamedSelector)) { |
255 ParameterStubMethod stub = | 254 ParameterStubMethod stub = |
256 generateParameterStub(member, renamedSelector, selector); | 255 generateParameterStub(member, renamedSelector, selector); |
257 if (stub != null) { | 256 if (stub != null) { |
(...skipping 17 matching lines...) Expand all Loading... |
275 generateParameterStub(member, selector, null); | 274 generateParameterStub(member, selector, null); |
276 if (stub != null) { | 275 if (stub != null) { |
277 stubs.add(stub); | 276 stubs.add(stub); |
278 } | 277 } |
279 } | 278 } |
280 } | 279 } |
281 | 280 |
282 return stubs; | 281 return stubs; |
283 } | 282 } |
284 } | 283 } |
OLD | NEW |