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

Side by Side Diff: frog/leg/emitter.dart

Issue 9667027: Collect is checks to only emit the ones that are needed. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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) 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 * A function element that represents a closure call. The signature is copied 6 * A function element that represents a closure call. The signature is copied
7 * from the given element. 7 * from the given element.
8 */ 8 */
9 class ClosureInvocationElement extends FunctionElement { 9 class ClosureInvocationElement extends FunctionElement {
10 ClosureInvocationElement(SourceString name, 10 ClosureInvocationElement(SourceString name,
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 // Emit the noSuchMethods on the Object prototype now, so that 305 // Emit the noSuchMethods on the Object prototype now, so that
306 // the code in the dynamicMethod can find them. Note that the 306 // the code in the dynamicMethod can find them. Note that the
307 // code in dynamicMethod is invoked before analyzing the full JS 307 // code in dynamicMethod is invoked before analyzing the full JS
308 // script. 308 // script.
309 emitNoSuchMethodCalls(buffer); 309 emitNoSuchMethodCalls(buffer);
310 } 310 }
311 } 311 }
312 312
313 void generateTypeTests(ClassElement cls, 313 void generateTypeTests(ClassElement cls,
314 void generateTypeTest(ClassElement element)) { 314 void generateTypeTest(ClassElement element)) {
315 generateTypeTest(cls); 315 if (compiler.universe.isChecks.contains(cls)) {
316 generateTypeTest(cls);
317 }
316 generateInterfacesIsTests(cls, generateTypeTest); 318 generateInterfacesIsTests(cls, generateTypeTest);
317 } 319 }
318 320
319 void generateInterfacesIsTests(ClassElement cls, 321 void generateInterfacesIsTests(ClassElement cls,
320 void generateTypeTest(ClassElement element)) { 322 void generateTypeTest(ClassElement element)) {
321 for (Type interfaceType in cls.interfaces) { 323 for (Type interfaceType in cls.interfaces) {
322 generateTypeTest(interfaceType.element); 324 Element element = interfaceType.element;
323 generateInterfacesIsTests(interfaceType.element, generateTypeTest); 325 if (compiler.universe.isChecks.contains(element)) {
326 generateTypeTest(element);
327 }
328 generateInterfacesIsTests(element, generateTypeTest);
324 } 329 }
325 } 330 }
326 331
327 void emitClasses(StringBuffer buffer) { 332 void emitClasses(StringBuffer buffer) {
328 Set seenClasses = new Set<ClassElement>(); 333 Set seenClasses = new Set<ClassElement>();
329 for (ClassElement element in compiler.universe.instantiatedClasses) { 334 for (ClassElement element in compiler.universe.instantiatedClasses) {
330 generateClass(element, buffer, seenClasses); 335 generateClass(element, buffer, seenClasses);
331 } 336 }
332 } 337 }
333 338
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 emitStaticFinalFieldInitializations(buffer); 617 emitStaticFinalFieldInitializations(buffer);
613 nativeEmitter.emitDynamicDispatchMetadata(buffer); 618 nativeEmitter.emitDynamicDispatchMetadata(buffer);
614 buffer.add('var ${namer.CURRENT_ISOLATE} = new ${namer.ISOLATE}();\n'); 619 buffer.add('var ${namer.CURRENT_ISOLATE} = new ${namer.ISOLATE}();\n');
615 Element main = compiler.mainApp.find(Compiler.MAIN); 620 Element main = compiler.mainApp.find(Compiler.MAIN);
616 buffer.add('${namer.isolateAccess(main)}();\n'); 621 buffer.add('${namer.isolateAccess(main)}();\n');
617 compiler.assembledCode = buffer.toString(); 622 compiler.assembledCode = buffer.toString();
618 }); 623 });
619 return compiler.assembledCode; 624 return compiler.assembledCode;
620 } 625 }
621 } 626 }
OLDNEW
« no previous file with comments | « frog/leg/compiler.dart ('k') | frog/leg/ssa/codegen.dart » ('j') | frog/leg/universe.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698