OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.program_builder; | 5 part of dart2js.js_emitter.program_builder; |
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 MethodElement function = element; | 127 MethodElement function = element; |
128 function.functionSignature.forEachParameter( | 128 function.functionSignature.forEachParameter( |
129 backend.mirrorsData.retainMetadataOfParameter); | 129 backend.mirrorsData.retainMetadataOfParameter); |
130 } | 130 } |
131 } | 131 } |
132 } | 132 } |
133 for (ClassElement cls in neededClasses) { | 133 for (ClassElement cls in neededClasses) { |
134 final onlyForRti = classesOnlyNeededForRti.contains(cls); | 134 final onlyForRti = classesOnlyNeededForRti.contains(cls); |
135 if (!onlyForRti) { | 135 if (!onlyForRti) { |
136 backend.mirrorsData.retainMetadataOfClass(cls); | 136 backend.mirrorsData.retainMetadataOfClass(cls); |
137 new FieldVisitor(compiler, namer, closedWorld).visitFields(cls, false, | 137 new FieldVisitor(compiler.options, compiler.codegenWorldBuilder, |
138 (FieldElement member, js.Name name, js.Name accessorName, | 138 backend.nativeData, backend.mirrorsData, namer, closedWorld) |
139 bool needsGetter, bool needsSetter, bool needsCheckedSetter) { | 139 .visitFields(cls, false, (FieldElement member, |
| 140 js.Name name, |
| 141 js.Name accessorName, |
| 142 bool needsGetter, |
| 143 bool needsSetter, |
| 144 bool needsCheckedSetter) { |
140 bool needsAccessor = needsGetter || needsSetter; | 145 bool needsAccessor = needsGetter || needsSetter; |
141 if (needsAccessor && | 146 if (needsAccessor && |
142 backend.mirrorsData.isMemberAccessibleByReflection(member)) { | 147 backend.mirrorsData.isMemberAccessibleByReflection(member)) { |
143 backend.mirrorsData.retainMetadataOfMember(member); | 148 backend.mirrorsData.retainMetadataOfMember(member); |
144 } | 149 } |
145 }); | 150 }); |
146 } | 151 } |
147 } | 152 } |
148 typedefsNeededForReflection | 153 typedefsNeededForReflection |
149 .forEach(backend.mirrorsData.retainMetadataOfTypedef); | 154 .forEach(backend.mirrorsData.retainMetadataOfTypedef); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 } | 331 } |
327 | 332 |
328 void collect() { | 333 void collect() { |
329 computeNeededDeclarations(); | 334 computeNeededDeclarations(); |
330 computeNeededConstants(); | 335 computeNeededConstants(); |
331 computeNeededStatics(); | 336 computeNeededStatics(); |
332 computeNeededStaticNonFinalFields(); | 337 computeNeededStaticNonFinalFields(); |
333 computeNeededLibraries(); | 338 computeNeededLibraries(); |
334 } | 339 } |
335 } | 340 } |
OLD | NEW |