| 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 class NativeEmitter { | 7 class NativeEmitter { |
| 8 | 8 |
| 9 final Map<Element, ClassBuilder> cachedBuilders; | 9 final Map<Element, ClassBuilder> cachedBuilders; |
| 10 | 10 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 Set<ClassElement> neededClasses = new Set<ClassElement>(); | 108 Set<ClassElement> neededClasses = new Set<ClassElement>(); |
| 109 Set<ClassElement> nonleafClasses = new Set<ClassElement>(); | 109 Set<ClassElement> nonleafClasses = new Set<ClassElement>(); |
| 110 | 110 |
| 111 Map<ClassElement, List<ClassElement>> extensionPoints = | 111 Map<ClassElement, List<ClassElement>> extensionPoints = |
| 112 computeExtensionPoints(preOrder); | 112 computeExtensionPoints(preOrder); |
| 113 | 113 |
| 114 neededClasses.add(compiler.objectClass); | 114 neededClasses.add(compiler.objectClass); |
| 115 | 115 |
| 116 Set<ClassElement> neededByConstant = | 116 Set<ClassElement> neededByConstant = |
| 117 emitterTask.interceptorEmitter.interceptorsReferencedFromConstants(); | 117 emitterTask.interceptorsReferencedFromConstants(); |
| 118 Set<ClassElement> modifiedClasses = | 118 Set<ClassElement> modifiedClasses = |
| 119 emitterTask.typeTestEmitter.classesModifiedByEmitRuntimeTypeSupport(); | 119 emitterTask.typeTestEmitter.classesModifiedByEmitRuntimeTypeSupport(); |
| 120 | 120 |
| 121 for (ClassElement classElement in preOrder.reversed) { | 121 for (ClassElement classElement in preOrder.reversed) { |
| 122 // Post-order traversal ensures we visit the subclasses before their | 122 // Post-order traversal ensures we visit the subclasses before their |
| 123 // superclass. This makes it easy to tell if a class is needed because a | 123 // superclass. This makes it easy to tell if a class is needed because a |
| 124 // subclass is needed. | 124 // subclass is needed. |
| 125 ClassBuilder builder = builders[classElement]; | 125 ClassBuilder builder = builders[classElement]; |
| 126 bool needed = false; | 126 bool needed = false; |
| 127 if (builder == null) { | 127 if (builder == null) { |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 if (emitterTask.compiler.enableMinification) targetBuffer.add(';'); | 475 if (emitterTask.compiler.enableMinification) targetBuffer.add(';'); |
| 476 targetBuffer.add(jsAst.prettyPrint( | 476 targetBuffer.add(jsAst.prettyPrint( |
| 477 new jsAst.ExpressionStatement(init), compiler)); | 477 new jsAst.ExpressionStatement(init), compiler)); |
| 478 targetBuffer.add('\n'); | 478 targetBuffer.add('\n'); |
| 479 } | 479 } |
| 480 | 480 |
| 481 targetBuffer.add(nativeBuffer); | 481 targetBuffer.add(nativeBuffer); |
| 482 targetBuffer.add('\n'); | 482 targetBuffer.add('\n'); |
| 483 } | 483 } |
| 484 } | 484 } |
| OLD | NEW |