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

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

Issue 881363006: Store the aliasName of a method in the model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.new_js_emitter.model; 5 library dart2js.new_js_emitter.model;
6 6
7 import '../js/js.dart' as js show Expression; 7 import '../js/js.dart' as js show Expression;
8 import '../constants/values.dart' show ConstantValue; 8 import '../constants/values.dart' show ConstantValue;
9 9
10 import '../deferred_load.dart' show OutputUnit; 10 import '../deferred_load.dart' show OutputUnit;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 } 309 }
310 310
311 /** 311 /**
312 * A method that corresponds to a method in the original Dart program. 312 * A method that corresponds to a method in the original Dart program.
313 */ 313 */
314 class DartMethod extends Method { 314 class DartMethod extends Method {
315 final bool needsTearOff; 315 final bool needsTearOff;
316 final String tearOffName; 316 final String tearOffName;
317 // TODO(herhut): Directly store stubs instead/ 317 // TODO(herhut): Directly store stubs instead/
318 final bool needsStubs; 318 final bool needsStubs;
319 // TODO(herhut): Directly store aliases instead.
320 final bool canBeApplied; 319 final bool canBeApplied;
321 320
322 DartMethod(Element element, String name, js.Expression code, 321 DartMethod(Element element, String name, js.Expression code,
323 {this.needsTearOff, this.tearOffName, this.needsStubs, this.canBeApplied}) 322 {this.needsTearOff, this.tearOffName, this.needsStubs, this.canBeApplied})
324 : super(element, name, code) { 323 : super(element, name, code) {
325 assert(needsTearOff != null); 324 assert(needsTearOff != null);
326 assert(!needsTearOff || tearOffName != null); 325 assert(!needsTearOff || tearOffName != null);
327 assert(canBeApplied != null); 326 assert(canBeApplied != null);
328 assert(needsStubs != null); 327 assert(needsStubs != null);
329 } 328 }
330 } 329 }
331 330
332 class InstanceMethod extends DartMethod { 331 class InstanceMethod extends DartMethod {
333 // TODO(herhut): Directly store aliases instead. 332 final String aliasName;
floitsch 2015/01/29 15:24:35 Add documentation what this is. When does it happe
herhut 2015/02/03 10:20:16 Done.
334 final bool hasSuperAlias;
335 final bool isClosure; 333 final bool isClosure;
336 334
337 InstanceMethod(element, name, code, 335 InstanceMethod(element, name, code,
338 {bool needsTearOff, 336 {bool needsTearOff,
339 String tearOffName, 337 String tearOffName,
340 this.hasSuperAlias, 338 this.aliasName,
341 bool canBeApplied, 339 bool canBeApplied,
342 this.isClosure, 340 this.isClosure,
343 bool needsStubs}) 341 bool needsStubs})
344 : super(element, name, code, 342 : super(element, name, code,
345 needsTearOff: needsTearOff, 343 needsTearOff: needsTearOff,
346 tearOffName: tearOffName, 344 tearOffName: tearOffName,
347 canBeApplied: canBeApplied, 345 canBeApplied: canBeApplied,
348 needsStubs: needsStubs) { 346 needsStubs: needsStubs) {
349 assert(hasSuperAlias != null);
350 assert(isClosure != null); 347 assert(isClosure != null);
351 } 348 }
352 } 349 }
353 350
354 /** 351 /**
355 * A method that is generated by the backend and has not direct correspondence 352 * A method that is generated by the backend and has not direct correspondence
356 * to a method in the original Dart program. Examples are getter and setter 353 * to a method in the original Dart program. Examples are getter and setter
357 * stubs and stubs to dispatch calls to methods with optional parameters. 354 * stubs and stubs to dispatch calls to methods with optional parameters.
358 */ 355 */
359 class StubMethod extends Method { 356 class StubMethod extends Method {
(...skipping 12 matching lines...) Expand all
372 tearOffName : tearOffName, 369 tearOffName : tearOffName,
373 canBeApplied : canBeApplied, 370 canBeApplied : canBeApplied,
374 needsStubs : needsStubs); 371 needsStubs : needsStubs);
375 } 372 }
376 373
377 class StaticStubMethod extends StubMethod { 374 class StaticStubMethod extends StubMethod {
378 Holder holder; 375 Holder holder;
379 StaticStubMethod(String name, this.holder, js.Expression code) 376 StaticStubMethod(String name, this.holder, js.Expression code)
380 : super(name, code); 377 : super(name, code);
381 } 378 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698