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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart

Issue 2320583002: Introduce OpenWorld. (Closed)
Patch Set: 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
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 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
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.closedWorld)) 251 if (!renamedSelector.appliesUnnamed(member, backend))
252 continue; 252 continue;
253 253
254 if (untypedSelectors.add(renamedSelector)) { 254 if (untypedSelectors.add(renamedSelector)) {
255 ParameterStubMethod stub = 255 ParameterStubMethod stub =
256 generateParameterStub(member, renamedSelector, selector); 256 generateParameterStub(member, renamedSelector, selector);
257 if (stub != null) { 257 if (stub != null) {
258 stubs.add(stub); 258 stubs.add(stub);
259 } 259 }
260 } 260 }
261 } 261 }
262 262
263 // 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
264 // `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
265 // call-selectors (and they are in the renamedCallSelectors set. 265 // call-selectors (and they are in the renamedCallSelectors set.
266 for (Selector selector in selectors.keys) { 266 for (Selector selector in selectors.keys) {
267 if (renamedCallSelectors.contains(selector)) continue; 267 if (renamedCallSelectors.contains(selector)) continue;
268 if (!selector.appliesUnnamed(member, compiler.closedWorld)) continue; 268 if (!selector.appliesUnnamed(member, backend)) continue;
269 if (!selectors[selector] 269 if (!selectors[selector]
270 .applies(member, selector, compiler.closedWorld)) { 270 .applies(member, selector, compiler.closedWorld)) {
271 continue; 271 continue;
272 } 272 }
273 273
274 if (untypedSelectors.add(selector)) { 274 if (untypedSelectors.add(selector)) {
275 ParameterStubMethod stub = 275 ParameterStubMethod stub =
276 generateParameterStub(member, selector, null); 276 generateParameterStub(member, selector, null);
277 if (stub != null) { 277 if (stub != null) {
278 stubs.add(stub); 278 stubs.add(stub);
279 } 279 }
280 } 280 }
281 } 281 }
282 282
283 return stubs; 283 return stubs;
284 } 284 }
285 } 285 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698