| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 234 |
| 235 // Emit the native class interceptors that were actually used. | 235 // Emit the native class interceptors that were actually used. |
| 236 for (ClassElement classElement in classes) { | 236 for (ClassElement classElement in classes) { |
| 237 if (!classElement.isNative) continue; | 237 if (!classElement.isNative) continue; |
| 238 if (neededClasses.contains(classElement)) { | 238 if (neededClasses.contains(classElement)) { |
| 239 // Define interceptor class for [classElement]. | 239 // Define interceptor class for [classElement]. |
| 240 emitterTask.oldEmitter.classEmitter.emitClassBuilderWithReflectionData( | 240 emitterTask.oldEmitter.classEmitter.emitClassBuilderWithReflectionData( |
| 241 backend.namer.getNameOfClass(classElement), | 241 backend.namer.getNameOfClass(classElement), |
| 242 classElement, builders[classElement], | 242 classElement, builders[classElement], |
| 243 emitterTask.oldEmitter.getElementDescriptor(classElement)); | 243 emitterTask.oldEmitter.getElementDescriptor(classElement)); |
| 244 emitterTask.oldEmitter.needsClassSupport = true; | 244 emitterTask.oldEmitter.needsDefineClass = true; |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 /** | 249 /** |
| 250 * Computes the native classes that are extended (subclassed) by non-native | 250 * Computes the native classes that are extended (subclassed) by non-native |
| 251 * classes and the set non-mative classes that extend them. (A List is used | 251 * classes and the set non-mative classes that extend them. (A List is used |
| 252 * instead of a Set for out stability). | 252 * instead of a Set for out stability). |
| 253 */ | 253 */ |
| 254 Map<ClassElement, List<ClassElement>> computeExtensionPoints( | 254 Map<ClassElement, List<ClassElement>> computeExtensionPoints( |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 if (emitterTask.compiler.enableMinification) targetBuffer.write(';'); | 473 if (emitterTask.compiler.enableMinification) targetBuffer.write(';'); |
| 474 targetBuffer.write(jsAst.prettyPrint( | 474 targetBuffer.write(jsAst.prettyPrint( |
| 475 new jsAst.ExpressionStatement(init), compiler)); | 475 new jsAst.ExpressionStatement(init), compiler)); |
| 476 targetBuffer.write('\n'); | 476 targetBuffer.write('\n'); |
| 477 } | 477 } |
| 478 | 478 |
| 479 targetBuffer.write(nativeBuffer); | 479 targetBuffer.write(nativeBuffer); |
| 480 targetBuffer.write('\n'); | 480 targetBuffer.write('\n'); |
| 481 } | 481 } |
| 482 } | 482 } |
| OLD | NEW |