Chromium Code Reviews| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 * Adds [element] to the work list if it has not already been processed. | 110 * Adds [element] to the work list if it has not already been processed. |
| 111 */ | 111 */ |
| 112 void internalAddToWorkList(Element element); | 112 void internalAddToWorkList(Element element); |
| 113 | 113 |
| 114 void registerInstantiatedType(InterfaceType type, TreeElements elements) { | 114 void registerInstantiatedType(InterfaceType type, TreeElements elements) { |
| 115 task.measure(() { | 115 task.measure(() { |
| 116 ClassElement cls = type.element; | 116 ClassElement cls = type.element; |
| 117 elements.registerDependency(cls); | 117 elements.registerDependency(cls); |
| 118 cls.ensureResolved(compiler); | 118 cls.ensureResolved(compiler); |
| 119 universe.instantiatedTypes.add(type); | 119 universe.instantiatedTypes.add(type); |
| 120 if (!cls.isAbstract(compiler)) { | 120 if (!cls.isAbstract(compiler) |
| 121 // We can't use the closed-world assumption with native abstract | |
| 122 // classes; a native abstract class may have non-abstract subclasses | |
| 123 // not declared to the program. Instances of these classes are | |
| 124 // indistinguishable from the abstract class. | |
| 125 || cls.isNative()) { | |
|
ngeoffray
2013/09/10 11:55:37
Could we avoid marking the native classes abstract
| |
| 121 universe.instantiatedClasses.add(cls); | 126 universe.instantiatedClasses.add(cls); |
| 122 } | 127 } |
| 123 onRegisterInstantiatedClass(cls); | 128 onRegisterInstantiatedClass(cls); |
| 124 }); | 129 }); |
| 125 } | 130 } |
| 126 | 131 |
| 127 void registerInstantiatedClass(ClassElement cls, TreeElements elements) { | 132 void registerInstantiatedClass(ClassElement cls, TreeElements elements) { |
| 128 cls.ensureResolved(compiler); | 133 cls.ensureResolved(compiler); |
| 129 registerInstantiatedType(cls.rawType, elements); | 134 registerInstantiatedType(cls.rawType, elements); |
| 130 } | 135 } |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 725 while(!queue.isEmpty) { | 730 while(!queue.isEmpty) { |
| 726 // TODO(johnniwinther): Find an optimal process order for codegen. | 731 // TODO(johnniwinther): Find an optimal process order for codegen. |
| 727 f(queue.removeLast()); | 732 f(queue.removeLast()); |
| 728 } | 733 } |
| 729 } | 734 } |
| 730 | 735 |
| 731 void _logSpecificSummary(log(message)) { | 736 void _logSpecificSummary(log(message)) { |
| 732 log('Compiled ${generatedCode.length} methods.'); | 737 log('Compiled ${generatedCode.length} methods.'); |
| 733 } | 738 } |
| 734 } | 739 } |
| OLD | NEW |