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

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

Issue 10978044: Avoid generating is$Object, and fix a typo in a condition. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 classElement.forEachMember(includeBackendMembers: true, 665 classElement.forEachMember(includeBackendMembers: true,
666 f: (ClassElement enclosing, Element member) { 666 f: (ClassElement enclosing, Element member) {
667 assert(invariant(classElement, member.isDeclaration)); 667 assert(invariant(classElement, member.isDeclaration));
668 if (member.isInstanceMember()) { 668 if (member.isInstanceMember()) {
669 addInstanceMember(member, defineInstanceMember); 669 addInstanceMember(member, defineInstanceMember);
670 } 670 }
671 }); 671 });
672 672
673 generateIsTestsOn(classElement, (Element other) { 673 generateIsTestsOn(classElement, (Element other) {
674 String code; 674 String code;
675 if (other.isObject(compiler)) return;
675 if (nativeEmitter.requiresNativeIsCheck(other)) { 676 if (nativeEmitter.requiresNativeIsCheck(other)) {
676 code = 'function() { return true; }'; 677 code = 'function() { return true; }';
677 } else { 678 } else {
678 code = 'true'; 679 code = 'true';
679 } 680 }
680 CodeBuffer typeTestBuffer = new CodeBuffer(); 681 CodeBuffer typeTestBuffer = new CodeBuffer();
681 typeTestBuffer.add(code); 682 typeTestBuffer.add(code);
682 defineInstanceMember(namer.operatorIs(other), typeTestBuffer); 683 defineInstanceMember(namer.operatorIs(other), typeTestBuffer);
683 }); 684 });
684 685
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 const String HOOKS_API_USAGE = """ 1435 const String HOOKS_API_USAGE = """
1435 // Generated by dart2js, the Dart to JavaScript compiler. 1436 // Generated by dart2js, the Dart to JavaScript compiler.
1436 // The code supports the following hooks: 1437 // The code supports the following hooks:
1437 // dartPrint(message) - if this function is defined it is called 1438 // dartPrint(message) - if this function is defined it is called
1438 // instead of the Dart [print] method. 1439 // instead of the Dart [print] method.
1439 // dartMainRunner(main) - if this function is defined, the Dart [main] 1440 // dartMainRunner(main) - if this function is defined, the Dart [main]
1440 // method will not be invoked directly. 1441 // method will not be invoked directly.
1441 // Instead, a closure that will invoke [main] is 1442 // Instead, a closure that will invoke [main] is
1442 // passed to [dartMainRunner]. 1443 // passed to [dartMainRunner].
1443 """; 1444 """;
OLDNEW
« no previous file with comments | « lib/compiler/implementation/enqueue.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