Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/enqueue.dart

Issue 23600020: Native abstract classes may be 'instantiated' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/compiler/dart2js_native/abstract_class_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js_native/abstract_class_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698