| 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 library dart2js.js.enqueue; | 5 library dart2js.js.enqueue; |
| 6 | 6 |
| 7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
| 8 | 8 |
| 9 import '../common/backend_api.dart' show Backend; | 9 import '../common/backend_api.dart' show Backend; |
| 10 import '../common/codegen.dart' show CodegenWorkItem; | 10 import '../common/codegen.dart' show CodegenWorkItem; |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 // TODO(johnniwinther): Avoid this. Currently [FIELD_GET] and | 524 // TODO(johnniwinther): Avoid this. Currently [FIELD_GET] and |
| 525 // [FIELD_SET] contains [BoxFieldElement]s which we cannot enqueue. | 525 // [FIELD_SET] contains [BoxFieldElement]s which we cannot enqueue. |
| 526 // Also [CLOSURE] contains [LocalFunctionElement] which we cannot | 526 // Also [CLOSURE] contains [LocalFunctionElement] which we cannot |
| 527 // enqueue. | 527 // enqueue. |
| 528 addElement = false; | 528 addElement = false; |
| 529 break; | 529 break; |
| 530 case StaticUseKind.SUPER_FIELD_SET: | 530 case StaticUseKind.SUPER_FIELD_SET: |
| 531 case StaticUseKind.SUPER_TEAR_OFF: | 531 case StaticUseKind.SUPER_TEAR_OFF: |
| 532 case StaticUseKind.GENERAL: | 532 case StaticUseKind.GENERAL: |
| 533 break; | 533 break; |
| 534 case StaticUseKind.CONSTRUCTOR_INVOKE: |
| 535 case StaticUseKind.CONST_CONSTRUCTOR_INVOKE: |
| 536 registerTypeUse(new TypeUse.instantiation(staticUse.type)); |
| 537 break; |
| 534 } | 538 } |
| 535 if (addElement) { | 539 if (addElement) { |
| 536 addToWorkList(element); | 540 addToWorkList(element); |
| 537 } | 541 } |
| 538 } | 542 } |
| 539 | 543 |
| 540 void registerTypeUse(TypeUse typeUse) { | 544 void registerTypeUse(TypeUse typeUse) { |
| 541 DartType type = typeUse.type; | 545 DartType type = typeUse.type; |
| 542 switch (typeUse.kind) { | 546 switch (typeUse.kind) { |
| 543 case TypeUseKind.INSTANTIATION: | 547 case TypeUseKind.INSTANTIATION: |
| 544 registerInstantiatedType(type); | 548 registerInstantiatedType(type); |
| 545 break; | 549 break; |
| 546 case TypeUseKind.INSTANTIATION: | |
| 547 case TypeUseKind.IS_CHECK: | 550 case TypeUseKind.IS_CHECK: |
| 548 case TypeUseKind.AS_CAST: | 551 case TypeUseKind.AS_CAST: |
| 549 case TypeUseKind.CATCH_TYPE: | 552 case TypeUseKind.CATCH_TYPE: |
| 550 _registerIsCheck(type); | 553 _registerIsCheck(type); |
| 551 break; | 554 break; |
| 552 case TypeUseKind.CHECKED_MODE_CHECK: | 555 case TypeUseKind.CHECKED_MODE_CHECK: |
| 553 if (options.enableTypeAssertions) { | 556 if (options.enableTypeAssertions) { |
| 554 _registerIsCheck(type); | 557 _registerIsCheck(type); |
| 555 } | 558 } |
| 556 break; | 559 break; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 @override | 702 @override |
| 700 void visitStaticUse(StaticUse staticUse) { | 703 void visitStaticUse(StaticUse staticUse) { |
| 701 enqueuer.registerStaticUse(staticUse); | 704 enqueuer.registerStaticUse(staticUse); |
| 702 } | 705 } |
| 703 | 706 |
| 704 @override | 707 @override |
| 705 void visitTypeUse(TypeUse typeUse) { | 708 void visitTypeUse(TypeUse typeUse) { |
| 706 enqueuer.registerTypeUse(typeUse); | 709 enqueuer.registerTypeUse(typeUse); |
| 707 } | 710 } |
| 708 } | 711 } |
| OLD | NEW |