| 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 = compiler.resolution.createWorkItem( | 806 ResolutionWorkItem workItem; |
| 807 element, itemCompilationContextCreator()); | 807 if (compiler.serialization.isDeserialized(element)) { |
| 808 workItem = compiler.serialization.createResolutionWorkItem( |
| 809 element, itemCompilationContextCreator()); |
| 810 } else { |
| 811 workItem = new ResolutionWorkItem( |
| 812 element, itemCompilationContextCreator()); |
| 813 } |
| 808 queue.add(workItem); | 814 queue.add(workItem); |
| 809 | 815 |
| 810 // Enable isolate support if we start using something from the isolate | 816 // Enable isolate support if we start using something from the isolate |
| 811 // library, or timers for the async library. We exclude constant fields, | 817 // library, or timers for the async library. We exclude constant fields, |
| 812 // which are ending here because their initializing expression is compiled. | 818 // which are ending here because their initializing expression is compiled. |
| 813 LibraryElement library = element.library; | 819 LibraryElement library = element.library; |
| 814 if (!compiler.hasIsolateSupport && | 820 if (!compiler.hasIsolateSupport && |
| 815 (!element.isField || !element.isConst)) { | 821 (!element.isField || !element.isConst)) { |
| 816 String uri = library.canonicalUri.toString(); | 822 String uri = library.canonicalUri.toString(); |
| 817 if (uri == 'dart:isolate') { | 823 if (uri == 'dart:isolate') { |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 @override | 1068 @override |
| 1063 void visitStaticUse(StaticUse staticUse) { | 1069 void visitStaticUse(StaticUse staticUse) { |
| 1064 enqueuer.registerStaticUse(staticUse); | 1070 enqueuer.registerStaticUse(staticUse); |
| 1065 } | 1071 } |
| 1066 | 1072 |
| 1067 @override | 1073 @override |
| 1068 void visitTypeUse(TypeUse typeUse) { | 1074 void visitTypeUse(TypeUse typeUse) { |
| 1069 enqueuer.registerTypeUse(typeUse); | 1075 enqueuer.registerTypeUse(typeUse); |
| 1070 } | 1076 } |
| 1071 } | 1077 } |
| OLD | NEW |