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.js_emitter; | 5 part of dart2js.js_emitter; |
6 | 6 |
7 /** | 7 /** |
8 * Generates the code for all used classes in the program. Static fields (even | 8 * Generates the code for all used classes in the program. Static fields (even |
9 * in classes) are ignored, since they can be treated as non-class elements. | 9 * in classes) are ignored, since they can be treated as non-class elements. |
10 * | 10 * |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 } | 803 } |
804 } | 804 } |
805 | 805 |
806 // These classes are just helpers for the backend's type system. | 806 // These classes are just helpers for the backend's type system. |
807 unneededClasses.add(backend.jsMutableArrayClass); | 807 unneededClasses.add(backend.jsMutableArrayClass); |
808 unneededClasses.add(backend.jsFixedArrayClass); | 808 unneededClasses.add(backend.jsFixedArrayClass); |
809 unneededClasses.add(backend.jsExtendableArrayClass); | 809 unneededClasses.add(backend.jsExtendableArrayClass); |
810 unneededClasses.add(backend.jsUInt32Class); | 810 unneededClasses.add(backend.jsUInt32Class); |
811 unneededClasses.add(backend.jsUInt31Class); | 811 unneededClasses.add(backend.jsUInt31Class); |
812 unneededClasses.add(backend.jsPositiveIntClass); | 812 unneededClasses.add(backend.jsPositiveIntClass); |
813 unneededClasses.add(compiler.dynamicClass); | |
814 | 813 |
815 return (ClassElement cls) => !unneededClasses.contains(cls); | 814 return (ClassElement cls) => !unneededClasses.contains(cls); |
816 } | 815 } |
817 | 816 |
818 void emitFinishClassesInvocationIfNecessary(CodeBuffer buffer) { | 817 void emitFinishClassesInvocationIfNecessary(CodeBuffer buffer) { |
819 if (needsDefineClass) { | 818 if (needsDefineClass) { |
820 buffer.write('$finishClassesName($classesCollector,' | 819 buffer.write('$finishClassesName($classesCollector,' |
821 '$_$isolateProperties,' | 820 '$_$isolateProperties,' |
822 '${_}null)$N'); | 821 '${_}null)$N'); |
823 | 822 |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1750 String sourceMap = sourceMapBuilder.build(); | 1749 String sourceMap = sourceMapBuilder.build(); |
1751 compiler.outputProvider(name, 'js.map') | 1750 compiler.outputProvider(name, 'js.map') |
1752 ..add(sourceMap) | 1751 ..add(sourceMap) |
1753 ..close(); | 1752 ..close(); |
1754 } | 1753 } |
1755 | 1754 |
1756 void registerReadTypeVariable(TypeVariableElement element) { | 1755 void registerReadTypeVariable(TypeVariableElement element) { |
1757 readTypeVariables.add(element); | 1756 readTypeVariables.add(element); |
1758 } | 1757 } |
1759 } | 1758 } |
OLD | NEW |