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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 | 241 |
242 Set<Selector> untypedSelectors = new Set<Selector>(); | 242 Set<Selector> untypedSelectors = new Set<Selector>(); |
243 | 243 |
244 // Start with the callSelectors since they imply the generation of the | 244 // Start with the callSelectors since they imply the generation of the |
245 // non-call version. | 245 // non-call version. |
246 for (Selector selector in callSelectors.keys) { | 246 for (Selector selector in callSelectors.keys) { |
247 Selector renamedSelector = | 247 Selector renamedSelector = |
248 new Selector.call(member.memberName, selector.callStructure); | 248 new Selector.call(member.memberName, selector.callStructure); |
249 renamedCallSelectors.add(renamedSelector); | 249 renamedCallSelectors.add(renamedSelector); |
250 | 250 |
251 if (!renamedSelector.appliesUnnamed(member, compiler.world)) continue; | 251 if (!renamedSelector.appliesUnnamed(member, compiler.closedWorld)) |
Harry Terkelsen
2016/09/20 17:47:41
nit: surround with curlies?
Johnni Winther
2016/09/21 07:44:53
Done.
| |
252 continue; | |
252 | 253 |
253 if (untypedSelectors.add(renamedSelector)) { | 254 if (untypedSelectors.add(renamedSelector)) { |
254 ParameterStubMethod stub = | 255 ParameterStubMethod stub = |
255 generateParameterStub(member, renamedSelector, selector); | 256 generateParameterStub(member, renamedSelector, selector); |
256 if (stub != null) { | 257 if (stub != null) { |
257 stubs.add(stub); | 258 stubs.add(stub); |
258 } | 259 } |
259 } | 260 } |
260 } | 261 } |
261 | 262 |
262 // Now run through the actual member selectors (eg. `foo$2(x, y)` and not | 263 // Now run through the actual member selectors (eg. `foo$2(x, y)` and not |
263 // `call$2(x, y)`. Some of them have already been generated because of the | 264 // `call$2(x, y)`. Some of them have already been generated because of the |
264 // call-selectors (and they are in the renamedCallSelectors set. | 265 // call-selectors (and they are in the renamedCallSelectors set. |
265 for (Selector selector in selectors.keys) { | 266 for (Selector selector in selectors.keys) { |
266 if (renamedCallSelectors.contains(selector)) continue; | 267 if (renamedCallSelectors.contains(selector)) continue; |
267 if (!selector.appliesUnnamed(member, compiler.world)) continue; | 268 if (!selector.appliesUnnamed(member, compiler.closedWorld)) continue; |
268 if (!selectors[selector].applies(member, selector, compiler.world)) { | 269 if (!selectors[selector] |
270 .applies(member, selector, compiler.closedWorld)) { | |
269 continue; | 271 continue; |
270 } | 272 } |
271 | 273 |
272 if (untypedSelectors.add(selector)) { | 274 if (untypedSelectors.add(selector)) { |
273 ParameterStubMethod stub = | 275 ParameterStubMethod stub = |
274 generateParameterStub(member, selector, null); | 276 generateParameterStub(member, selector, null); |
275 if (stub != null) { | 277 if (stub != null) { |
276 stubs.add(stub); | 278 stubs.add(stub); |
277 } | 279 } |
278 } | 280 } |
279 } | 281 } |
280 | 282 |
281 return stubs; | 283 return stubs; |
282 } | 284 } |
283 } | 285 } |
OLD | NEW |