Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 assert(needsTearOff != null); | 352 assert(needsTearOff != null); |
| 353 assert(!needsTearOff || tearOffName != null); | 353 assert(!needsTearOff || tearOffName != null); |
| 354 assert(canBeApplied != null); | 354 assert(canBeApplied != null); |
| 355 assert(canBeReflected != null); | 355 assert(canBeReflected != null); |
| 356 assert(needsStubs != null); | 356 assert(needsStubs != null); |
| 357 } | 357 } |
| 358 } | 358 } |
| 359 | 359 |
| 360 class InstanceMethod extends DartMethod { | 360 class InstanceMethod extends DartMethod { |
| 361 // TODO(herhut): Directly store aliases instead. | 361 // TODO(herhut): Directly store aliases instead. |
| 362 final bool hasSuperAlias; | 362 final String superAlias; |
|
floitsch
2015/01/30 18:31:05
Explain what this is, and what the emitter has to
| |
| 363 final bool isClosure; | 363 final bool isClosure; |
| 364 | 364 |
| 365 InstanceMethod(Element element, String name, js.Expression code, | 365 InstanceMethod(Element element, String name, js.Expression code, |
| 366 List<AdapterStubMethod> adapterStubs, | 366 List<AdapterStubMethod> adapterStubs, |
| 367 String callName, | 367 String callName, |
| 368 {bool needsTearOff, | 368 {bool needsTearOff, |
| 369 String tearOffName, | 369 String tearOffName, |
| 370 this.hasSuperAlias, | 370 this.superAlias, |
| 371 bool canBeApplied, | 371 bool canBeApplied, |
| 372 bool canBeReflected, | 372 bool canBeReflected, |
| 373 this.isClosure, | 373 this.isClosure, |
| 374 bool needsStubs}) | 374 bool needsStubs}) |
| 375 : super(element, name, code, adapterStubs, callName, | 375 : super(element, name, code, adapterStubs, callName, |
| 376 needsTearOff: needsTearOff, | 376 needsTearOff: needsTearOff, |
| 377 tearOffName: tearOffName, | 377 tearOffName: tearOffName, |
| 378 canBeApplied: canBeApplied, | 378 canBeApplied: canBeApplied, |
| 379 canBeReflected: canBeReflected, | 379 canBeReflected: canBeReflected, |
| 380 needsStubs: needsStubs) { | 380 needsStubs: needsStubs) { |
| 381 assert(hasSuperAlias != null); | |
| 382 assert(isClosure != null); | 381 assert(isClosure != null); |
| 383 } | 382 } |
| 384 } | 383 } |
| 385 | 384 |
| 386 /// A method that is generated by the backend and has not direct correspondence | 385 /// A method that is generated by the backend and has not direct correspondence |
| 387 /// to a method in the original Dart program. Examples are getter and setter | 386 /// to a method in the original Dart program. Examples are getter and setter |
| 388 /// stubs and stubs to dispatch calls to methods with optional parameters. | 387 /// stubs and stubs to dispatch calls to methods with optional parameters. |
| 389 class StubMethod extends Method { | 388 class StubMethod extends Method { |
| 390 StubMethod(String name, js.Expression code, | 389 StubMethod(String name, js.Expression code, |
| 391 {Element element}) | 390 {Element element}) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 431 canBeApplied : canBeApplied, | 430 canBeApplied : canBeApplied, |
| 432 canBeReflected : canBeReflected, | 431 canBeReflected : canBeReflected, |
| 433 needsStubs : needsStubs); | 432 needsStubs : needsStubs); |
| 434 } | 433 } |
| 435 | 434 |
| 436 class StaticStubMethod extends StubMethod implements StaticMethod { | 435 class StaticStubMethod extends StubMethod implements StaticMethod { |
| 437 Holder holder; | 436 Holder holder; |
| 438 StaticStubMethod(String name, this.holder, js.Expression code) | 437 StaticStubMethod(String name, this.holder, js.Expression code) |
| 439 : super(name, code); | 438 : super(name, code); |
| 440 } | 439 } |
| OLD | NEW |