OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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; | 5 part of dart2js; |
6 | 6 |
7 class EnqueueTask extends CompilerTask { | 7 class EnqueueTask extends CompilerTask { |
8 final ResolutionEnqueuer resolution; | 8 final ResolutionEnqueuer resolution; |
9 final CodegenEnqueuer codegen; | 9 final CodegenEnqueuer codegen; |
10 | 10 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 void registerIsCheck(DartType type, TreeElements elements) { | 379 void registerIsCheck(DartType type, TreeElements elements) { |
380 // Even in checked mode, type annotations for return type and argument | 380 // Even in checked mode, type annotations for return type and argument |
381 // types do not imply type checks, so there should never be a check | 381 // types do not imply type checks, so there should never be a check |
382 // against the type variable of a typedef. | 382 // against the type variable of a typedef. |
383 assert(type.kind != TypeKind.TYPE_VARIABLE || | 383 assert(type.kind != TypeKind.TYPE_VARIABLE || |
384 !type.element.enclosingElement.isTypedef()); | 384 !type.element.enclosingElement.isTypedef()); |
385 universe.isChecks.add(type); | 385 universe.isChecks.add(type); |
386 compiler.backend.registerIsCheck(type, this, elements); | 386 compiler.backend.registerIsCheck(type, this, elements); |
387 } | 387 } |
388 | 388 |
| 389 /** |
| 390 * If a factory constructor is used with type arguments, we lose track |
| 391 * which arguments could be used to create instances of classes that use their |
| 392 * type variables as expressions, so we have to remember if we saw such a use. |
| 393 */ |
| 394 void registerFactoryWithTypeArguments(TreeElements elements) { |
| 395 universe.usingFactoryWithTypeArguments = true; |
| 396 } |
| 397 |
389 void registerAsCheck(DartType type, TreeElements elements) { | 398 void registerAsCheck(DartType type, TreeElements elements) { |
390 registerIsCheck(type, elements); | 399 registerIsCheck(type, elements); |
391 compiler.backend.registerAsCheck(type, elements); | 400 compiler.backend.registerAsCheck(type, elements); |
392 } | 401 } |
393 | 402 |
394 void forEach(f(WorkItem work)); | 403 void forEach(f(WorkItem work)); |
395 | 404 |
396 void logSummary(log(message)) { | 405 void logSummary(log(message)) { |
397 _logSpecificSummary(log); | 406 _logSpecificSummary(log); |
398 nativeEnqueuer.logSummary(log); | 407 nativeEnqueuer.logSummary(log); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 while(!queue.isEmpty) { | 572 while(!queue.isEmpty) { |
564 // TODO(johnniwinther): Find an optimal process order for codegen. | 573 // TODO(johnniwinther): Find an optimal process order for codegen. |
565 f(queue.removeLast()); | 574 f(queue.removeLast()); |
566 } | 575 } |
567 } | 576 } |
568 | 577 |
569 void _logSpecificSummary(log(message)) { | 578 void _logSpecificSummary(log(message)) { |
570 log('Compiled ${generatedCode.length} methods.'); | 579 log('Compiled ${generatedCode.length} methods.'); |
571 } | 580 } |
572 } | 581 } |
OLD | NEW |