| 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.enqueue; | 5 library dart2js.enqueue; |
| 6 | 6 |
| 7 import 'dart:collection' show | 7 import 'dart:collection' show |
| 8 Queue; | 8 Queue; |
| 9 | 9 |
| 10 import 'common.dart'; | 10 import 'common.dart'; |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 assert(invariant(element, element is AnalyzableElement, | 796 assert(invariant(element, element is AnalyzableElement, |
| 797 message: 'Element $element is not analyzable.')); | 797 message: 'Element $element is not analyzable.')); |
| 798 if (hasBeenProcessed(element)) return false; | 798 if (hasBeenProcessed(element)) return false; |
| 799 if (queueIsClosed) { | 799 if (queueIsClosed) { |
| 800 throw new SpannableAssertionFailure(element, | 800 throw new SpannableAssertionFailure(element, |
| 801 "Resolution work list is closed. Trying to add $element."); | 801 "Resolution work list is closed. Trying to add $element."); |
| 802 } | 802 } |
| 803 | 803 |
| 804 compiler.world.registerUsedElement(element); | 804 compiler.world.registerUsedElement(element); |
| 805 | 805 |
| 806 ResolutionWorkItem workItem; | 806 ResolutionWorkItem workItem = compiler.resolution.createWorkItem( |
| 807 if (compiler.serialization.isDeserialized(element)) { | 807 element, itemCompilationContextCreator()); |
| 808 workItem = compiler.serialization.createResolutionWorkItem( | |
| 809 element, itemCompilationContextCreator()); | |
| 810 } else { | |
| 811 workItem = new ResolutionWorkItem( | |
| 812 element, itemCompilationContextCreator()); | |
| 813 } | |
| 814 queue.add(workItem); | 808 queue.add(workItem); |
| 815 | 809 |
| 816 // Enable isolate support if we start using something from the isolate | 810 // Enable isolate support if we start using something from the isolate |
| 817 // library, or timers for the async library. We exclude constant fields, | 811 // library, or timers for the async library. We exclude constant fields, |
| 818 // which are ending here because their initializing expression is compiled. | 812 // which are ending here because their initializing expression is compiled. |
| 819 LibraryElement library = element.library; | 813 LibraryElement library = element.library; |
| 820 if (!compiler.hasIsolateSupport && | 814 if (!compiler.hasIsolateSupport && |
| 821 (!element.isField || !element.isConst)) { | 815 (!element.isField || !element.isConst)) { |
| 822 String uri = library.canonicalUri.toString(); | 816 String uri = library.canonicalUri.toString(); |
| 823 if (uri == 'dart:isolate') { | 817 if (uri == 'dart:isolate') { |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 @override | 1062 @override |
| 1069 void visitStaticUse(StaticUse staticUse) { | 1063 void visitStaticUse(StaticUse staticUse) { |
| 1070 enqueuer.registerStaticUse(staticUse); | 1064 enqueuer.registerStaticUse(staticUse); |
| 1071 } | 1065 } |
| 1072 | 1066 |
| 1073 @override | 1067 @override |
| 1074 void visitTypeUse(TypeUse typeUse) { | 1068 void visitTypeUse(TypeUse typeUse) { |
| 1075 enqueuer.registerTypeUse(typeUse); | 1069 enqueuer.registerTypeUse(typeUse); |
| 1076 } | 1070 } |
| 1077 } | 1071 } |
| OLD | NEW |