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

Side by Side Diff: lib/compiler/implementation/js_backend/emitter.dart

Issue 10919123: Reapply Issue 10911006. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 if (!checkedSetters.isEmpty()) { 654 if (!checkedSetters.isEmpty()) {
655 buffer.add(',\n'); 655 buffer.add(',\n');
656 buffer.add('${Strings.join(checkedSetters, ",\n")}'); 656 buffer.add('${Strings.join(checkedSetters, ",\n")}');
657 } 657 }
658 emitInstanceMembers(classElement, buffer, true); 658 emitInstanceMembers(classElement, buffer, true);
659 buffer.add('\n};\n\n'); 659 buffer.add('\n};\n\n');
660 } 660 }
661 661
662 void generateTypeTests(ClassElement cls, 662 void generateTypeTests(ClassElement cls,
663 void generateTypeTest(ClassElement element)) { 663 void generateTypeTest(ClassElement element)) {
664 if (compiler.codegenWorld.isChecks.contains(cls)) { 664 if (compiler.codegenWorld.checkedClasses.contains(cls)) {
665 generateTypeTest(cls); 665 generateTypeTest(cls);
666 } 666 }
667 generateInterfacesIsTests(cls, generateTypeTest, new Set<Element>()); 667 generateInterfacesIsTests(cls, generateTypeTest, new Set<Element>());
668 } 668 }
669 669
670 void generateInterfacesIsTests(ClassElement cls, 670 void generateInterfacesIsTests(ClassElement cls,
671 void generateTypeTest(ClassElement element), 671 void generateTypeTest(ClassElement element),
672 Set<Element> alreadyGenerated) { 672 Set<Element> alreadyGenerated) {
673 for (DartType interfaceType in cls.interfaces) { 673 for (DartType interfaceType in cls.interfaces) {
674 Element element = interfaceType.element; 674 Element element = interfaceType.element;
675 if (!alreadyGenerated.contains(element) && 675 if (!alreadyGenerated.contains(element) &&
676 compiler.codegenWorld.isChecks.contains(element)) { 676 compiler.codegenWorld.checkedClasses.contains(element)) {
677 alreadyGenerated.add(element); 677 alreadyGenerated.add(element);
678 generateTypeTest(element); 678 generateTypeTest(element);
679 } 679 }
680 generateInterfacesIsTests(element, generateTypeTest, alreadyGenerated); 680 generateInterfacesIsTests(element, generateTypeTest, alreadyGenerated);
681 } 681 }
682 } 682 }
683 683
684 void emitClasses(CodeBuffer buffer) { 684 void emitClasses(CodeBuffer buffer) {
685 Set<ClassElement> instantiatedClasses = 685 Set<ClassElement> instantiatedClasses =
686 compiler.codegenWorld.instantiatedClasses; 686 compiler.codegenWorld.instantiatedClasses;
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 sourceName = token.slowToString(); 1297 sourceName = token.slowToString();
1298 } 1298 }
1299 sourceMapBuilder.addMapping( 1299 sourceMapBuilder.addMapping(
1300 sourceFile, token.charOffset, sourceName, offset); 1300 sourceFile, token.charOffset, sourceName, offset);
1301 }); 1301 });
1302 return sourceMapBuilder.build(compiledFile); 1302 return sourceMapBuilder.build(compiledFile);
1303 } 1303 }
1304 } 1304 }
1305 1305
1306 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition); 1306 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition);
OLDNEW
« no previous file with comments | « lib/compiler/implementation/js_backend/backend.dart ('k') | lib/compiler/implementation/js_backend/native_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698