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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart

Issue 996263002: Don't generate forwarding hooks if all noSuchMethod implementations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix typo Created 5 years, 9 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 class ClassEmitter extends CodeEmitterHelper { 7 class ClassEmitter extends CodeEmitterHelper {
8 8
9 ClassStubGenerator get _stubGenerator => 9 ClassStubGenerator get _stubGenerator =>
10 new ClassStubGenerator(compiler, namer, backend); 10 new ClassStubGenerator(compiler, namer, backend);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 emitter.containerBuilder.addMemberField(field, builder); 236 emitter.containerBuilder.addMemberField(field, builder);
237 } 237 }
238 238
239 for (Method method in cls.methods) { 239 for (Method method in cls.methods) {
240 assert(invariant(classElement, method.element.isDeclaration)); 240 assert(invariant(classElement, method.element.isDeclaration));
241 assert(invariant(classElement, method.element.isInstanceMember)); 241 assert(invariant(classElement, method.element.isInstanceMember));
242 emitter.containerBuilder.addMemberMethod(method, builder); 242 emitter.containerBuilder.addMemberMethod(method, builder);
243 } 243 }
244 244
245 if (identical(classElement, compiler.objectClass) 245 if (identical(classElement, compiler.objectClass)
246 && compiler.enabledNoSuchMethod) { 246 && backend.enabledNoSuchMethod) {
247 // Emit the noSuchMethod handlers on the Object prototype now, 247 // Emit the noSuchMethod handlers on the Object prototype now,
248 // so that the code in the dynamicFunction helper can find 248 // so that the code in the dynamicFunction helper can find
249 // them. Note that this helper is invoked before analyzing the 249 // them. Note that this helper is invoked before analyzing the
250 // full JS script. 250 // full JS script.
251 emitter.nsmEmitter.emitNoSuchMethodHandlers(builder.addProperty); 251 emitter.nsmEmitter.emitNoSuchMethodHandlers(builder.addProperty);
252 } 252 }
253 } 253 }
254 254
255 /// Emits the members from the model. 255 /// Emits the members from the model.
256 void emitRuntimeTypeInformation(Class cls, ClassBuilder builder) { 256 void emitRuntimeTypeInformation(Class cls, ClassBuilder builder) {
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 ? new Selector.getter(member.name, member.library) 544 ? new Selector.getter(member.name, member.library)
545 : new Selector.setter(member.name, member.library); 545 : new Selector.setter(member.name, member.library);
546 String reflectionName = emitter.getReflectionName(selector, name); 546 String reflectionName = emitter.getReflectionName(selector, name);
547 if (reflectionName != null) { 547 if (reflectionName != null) {
548 var reflectable = 548 var reflectable =
549 js(backend.isAccessibleByReflection(member) ? '1' : '0'); 549 js(backend.isAccessibleByReflection(member) ? '1' : '0');
550 builder.addProperty('+$reflectionName', reflectable); 550 builder.addProperty('+$reflectionName', reflectable);
551 } 551 }
552 } 552 }
553 } 553 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/no_such_method_registry.dart ('k') | pkg/compiler/lib/src/js_emitter/program_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698