| 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 /** | 5 /** |
| 6 * Generates the code for all used classes in the program. Static fields (even | 6 * Generates the code for all used classes in the program. Static fields (even |
| 7 * in classes) are ignored, since they can be treated as non-class elements. | 7 * in classes) are ignored, since they can be treated as non-class elements. |
| 8 * | 8 * |
| 9 * The code for the containing (used) methods must exist in the [:universe:]. | 9 * The code for the containing (used) methods must exist in the [:universe:]. |
| 10 */ | 10 */ |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 if (member.isInstanceMember()) { | 226 if (member.isInstanceMember()) { |
| 227 addInstanceMember(member, prototype, buffer); | 227 addInstanceMember(member, prototype, buffer); |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 for (Element member in classElement.backendMembers) { | 230 for (Element member in classElement.backendMembers) { |
| 231 if (member.isInstanceMember()) { | 231 if (member.isInstanceMember()) { |
| 232 addInstanceMember(member, prototype, buffer); | 232 addInstanceMember(member, prototype, buffer); |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 buffer.add('$prototype.${namer.operatorIs(classElement)} = true;\n'); | 235 buffer.add('$prototype.${namer.operatorIs(classElement)} = true;\n'); |
| 236 for (Type ifc in classElement.interfaces) { |
| 237 buffer.add('$prototype.${namer.operatorIs(ifc.element)} = true;\n'); |
| 238 } |
| 236 } | 239 } |
| 237 | 240 |
| 238 void emitClasses(StringBuffer buffer) { | 241 void emitClasses(StringBuffer buffer) { |
| 239 Set seenClasses = new Set<ClassElement>(); | 242 Set seenClasses = new Set<ClassElement>(); |
| 240 for (ClassElement element in compiler.universe.instantiatedClasses) { | 243 for (ClassElement element in compiler.universe.instantiatedClasses) { |
| 241 generateClass(element, buffer, seenClasses); | 244 generateClass(element, buffer, seenClasses); |
| 242 } | 245 } |
| 243 } | 246 } |
| 244 | 247 |
| 245 void emitStaticFunctionsWithNamer(StringBuffer buffer, | 248 void emitStaticFunctionsWithNamer(StringBuffer buffer, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 emitStaticFunctions(buffer); | 359 emitStaticFunctions(buffer); |
| 357 emitStaticFinalFieldInitializations(buffer); | 360 emitStaticFinalFieldInitializations(buffer); |
| 358 buffer.add('var ${namer.CURRENT_ISOLATE} = new ${namer.ISOLATE}();\n'); | 361 buffer.add('var ${namer.CURRENT_ISOLATE} = new ${namer.ISOLATE}();\n'); |
| 359 Element main = compiler.mainApp.find(Compiler.MAIN); | 362 Element main = compiler.mainApp.find(Compiler.MAIN); |
| 360 buffer.add('${namer.isolateAccess(main)}();\n'); | 363 buffer.add('${namer.isolateAccess(main)}();\n'); |
| 361 compiler.assembledCode = buffer.toString(); | 364 compiler.assembledCode = buffer.toString(); |
| 362 }); | 365 }); |
| 363 return compiler.assembledCode; | 366 return compiler.assembledCode; |
| 364 } | 367 } |
| 365 } | 368 } |
| OLD | NEW |