OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /// This class should morph into something that makes it easy to build | 7 /// This class should morph into something that makes it easy to build |
8 /// JavaScript representations of libraries, class-sides, and instance-sides. | 8 /// JavaScript representations of libraries, class-sides, and instance-sides. |
9 /// Initially, it is just a placeholder for code that is moved from | 9 /// Initially, it is just a placeholder for code that is moved from |
10 /// [CodeEmitterTask]. | 10 /// [CodeEmitterTask]. |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 356 |
357 FunctionSignature parameters = member.functionSignature; | 357 FunctionSignature parameters = member.functionSignature; |
358 bool needsStubs = !parameters.optionalParameters.isEmpty; | 358 bool needsStubs = !parameters.optionalParameters.isEmpty; |
359 bool canTearOff = false; | 359 bool canTearOff = false; |
360 bool isClosure = false; | 360 bool isClosure = false; |
361 bool isNotApplyTarget = !member.isFunction || | 361 bool isNotApplyTarget = !member.isFunction || |
362 member.isConstructor || | 362 member.isConstructor || |
363 member.isAccessor; | 363 member.isAccessor; |
364 String tearOffName; | 364 String tearOffName; |
365 | 365 |
366 final bool canBeReflected = backend.isAccessibleByReflection(member); | 366 |
| 367 final bool canBeReflected = backend.isAccessibleByReflection(member) || |
| 368 // During incremental compilation, we have to assume that reflection |
| 369 // *might* get enabled. |
| 370 compiler.hasIncrementalSupport; |
367 | 371 |
368 if (isNotApplyTarget) { | 372 if (isNotApplyTarget) { |
369 canTearOff = false; | 373 canTearOff = false; |
370 } else if (member.isInstanceMember) { | 374 } else if (member.isInstanceMember) { |
371 if (member.enclosingClass.isClosure) { | 375 if (member.enclosingClass.isClosure) { |
372 canTearOff = false; | 376 canTearOff = false; |
373 isClosure = true; | 377 isClosure = true; |
374 } else { | 378 } else { |
375 // Careful with operators. | 379 // Careful with operators. |
376 canTearOff = | 380 canTearOff = |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 assert(needsStubs != null); | 666 assert(needsStubs != null); |
663 assert(canTearOff != null); | 667 assert(canTearOff != null); |
664 assert(isClosure != null); | 668 assert(isClosure != null); |
665 assert(tearOffName != null || !canTearOff); | 669 assert(tearOffName != null || !canTearOff); |
666 assert(canBeReflected != null); | 670 assert(canBeReflected != null); |
667 assert(canBeApplied != null); | 671 assert(canBeApplied != null); |
668 assert(hasSuperAlias != null); | 672 assert(hasSuperAlias != null); |
669 assert(needStructuredInfo != null); | 673 assert(needStructuredInfo != null); |
670 } | 674 } |
671 } | 675 } |
OLD | NEW |