Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart

Issue 360493002: Emit declarations for typedefs that are needed by reflection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 237 }
238 238
239 // Emit the native class interceptors that were actually used. 239 // Emit the native class interceptors that were actually used.
240 for (ClassElement classElement in classes) { 240 for (ClassElement classElement in classes) {
241 if (!classElement.isNative) continue; 241 if (!classElement.isNative) continue;
242 if (neededClasses.contains(classElement)) { 242 if (neededClasses.contains(classElement)) {
243 // Define interceptor class for [classElement]. 243 // Define interceptor class for [classElement].
244 emitter.classEmitter.emitClassBuilderWithReflectionData( 244 emitter.classEmitter.emitClassBuilderWithReflectionData(
245 backend.namer.getNameOfClass(classElement), 245 backend.namer.getNameOfClass(classElement),
246 classElement, builders[classElement], 246 classElement, builders[classElement],
247 emitter.getElementDecriptor(classElement)); 247 emitter.getElementDescriptor(classElement));
248 emitter.needsDefineClass = true; 248 emitter.needsDefineClass = true;
249 } 249 }
250 } 250 }
251 } 251 }
252 252
253 /** 253 /**
254 * Computes the native classes that are extended (subclassed) by non-native 254 * Computes the native classes that are extended (subclassed) by non-native
255 * classes and the set non-mative classes that extend them. (A List is used 255 * classes and the set non-mative classes that extend them. (A List is used
256 * instead of a Set for out stability). 256 * instead of a Set for out stability).
257 */ 257 */
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 if (emitter.compiler.enableMinification) targetBuffer.add(';'); 472 if (emitter.compiler.enableMinification) targetBuffer.add(';');
473 targetBuffer.add(jsAst.prettyPrint( 473 targetBuffer.add(jsAst.prettyPrint(
474 new jsAst.ExpressionStatement(init), compiler)); 474 new jsAst.ExpressionStatement(init), compiler));
475 targetBuffer.add('\n'); 475 targetBuffer.add('\n');
476 } 476 }
477 477
478 targetBuffer.add(nativeBuffer); 478 targetBuffer.add(nativeBuffer);
479 targetBuffer.add('\n'); 479 targetBuffer.add('\n');
480 } 480 }
481 } 481 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698