OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.ir_builder_task; | 5 library dart2js.ir_builder_task; |
6 | 6 |
7 import '../closure.dart' as closurelib; | 7 import '../closure.dart' as closurelib; |
8 import '../closure.dart' hide ClosureScope; | 8 import '../closure.dart' hide ClosureScope; |
9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 Set<Element> resolved = compiler.enqueuer.resolution.resolvedElements; | 94 Set<Element> resolved = compiler.enqueuer.resolution.resolvedElements; |
95 resolved.forEach(buildNode); | 95 resolved.forEach(buildNode); |
96 }); | 96 }); |
97 } | 97 } |
98 | 98 |
99 bool canBuild(Element element) { | 99 bool canBuild(Element element) { |
100 // If using JavaScript backend, don't try to bail out early. | 100 // If using JavaScript backend, don't try to bail out early. |
101 if (compiler.backend is JavaScriptBackend) return true; | 101 if (compiler.backend is JavaScriptBackend) return true; |
102 | 102 |
103 if (element is TypedefElement) return false; | 103 if (element is TypedefElement) return false; |
| 104 if (element is ClassElement) return false; |
104 if (element is FunctionElement) { | 105 if (element is FunctionElement) { |
105 // TODO(sigurdm): Support native functions for dart2js. | 106 // TODO(sigurdm): Support native functions for dart2js. |
106 assert(invariant(element, !element.isNative)); | 107 assert(invariant(element, !element.isNative)); |
107 | 108 |
108 if (element is ConstructorElement) { | 109 if (element is ConstructorElement) { |
109 if (!element.isGenerativeConstructor) { | 110 if (!element.isGenerativeConstructor) { |
110 // TODO(kmillikin,sigurdm): Support constructors. | 111 // TODO(kmillikin,sigurdm): Support constructors. |
111 return false; | 112 return false; |
112 } | 113 } |
113 if (element.isSynthesized) { | 114 if (element.isSynthesized) { |
(...skipping 3004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3118 node.body = replacementFor(node.body); | 3119 node.body = replacementFor(node.body); |
3119 } | 3120 } |
3120 } | 3121 } |
3121 | 3122 |
3122 /// Visit a just-deleted subterm and unlink all [Reference]s in it. | 3123 /// Visit a just-deleted subterm and unlink all [Reference]s in it. |
3123 class RemovalVisitor extends ir.RecursiveVisitor { | 3124 class RemovalVisitor extends ir.RecursiveVisitor { |
3124 processReference(ir.Reference reference) { | 3125 processReference(ir.Reference reference) { |
3125 reference.unlink(); | 3126 reference.unlink(); |
3126 } | 3127 } |
3127 } | 3128 } |
OLD | NEW |