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

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

Issue 11412105: - Move length getter and setter interceptors to the new interceptor scheme. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 typedef void Recompile(Element element); 7 typedef void Recompile(Element element);
8 8
9 class ReturnInfo { 9 class ReturnInfo {
10 HType returnType; 10 HType returnType;
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 648
649 ClassElement jsStringClass; 649 ClassElement jsStringClass;
650 ClassElement jsArrayClass; 650 ClassElement jsArrayClass;
651 ClassElement jsNumberClass; 651 ClassElement jsNumberClass;
652 ClassElement jsIntClass; 652 ClassElement jsIntClass;
653 ClassElement jsDoubleClass; 653 ClassElement jsDoubleClass;
654 ClassElement jsFunctionClass; 654 ClassElement jsFunctionClass;
655 ClassElement jsNullClass; 655 ClassElement jsNullClass;
656 ClassElement jsBoolClass; 656 ClassElement jsBoolClass;
657 ClassElement objectInterceptorClass; 657 ClassElement objectInterceptorClass;
658 Element jsArrayLength;
659 Element jsStringLength;
658 Element getInterceptorMethod; 660 Element getInterceptorMethod;
659 bool _interceptorsAreInitialized = false; 661 bool _interceptorsAreInitialized = false;
660 662
661 final Namer namer; 663 final Namer namer;
662 664
663 /** 665 /**
664 * Interface used to determine if an object has the JavaScript 666 * Interface used to determine if an object has the JavaScript
665 * indexing behavior. The interface is only visible to specific 667 * indexing behavior. The interface is only visible to specific
666 * libraries. 668 * libraries.
667 */ 669 */
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 jsIntClass = 763 jsIntClass =
762 compiler.findInterceptor(const SourceString('JSInt')); 764 compiler.findInterceptor(const SourceString('JSInt'));
763 jsDoubleClass = 765 jsDoubleClass =
764 compiler.findInterceptor(const SourceString('JSDouble')); 766 compiler.findInterceptor(const SourceString('JSDouble'));
765 jsNullClass = 767 jsNullClass =
766 compiler.findInterceptor(const SourceString('JSNull')); 768 compiler.findInterceptor(const SourceString('JSNull'));
767 jsFunctionClass = 769 jsFunctionClass =
768 compiler.findInterceptor(const SourceString('JSFunction')); 770 compiler.findInterceptor(const SourceString('JSFunction'));
769 jsBoolClass = 771 jsBoolClass =
770 compiler.findInterceptor(const SourceString('JSBool')); 772 compiler.findInterceptor(const SourceString('JSBool'));
773 jsArrayLength =
774 jsArrayClass.lookupLocalMember(const SourceString('length'));
775 jsStringLength =
776 jsStringClass.lookupLocalMember(const SourceString('length'));
771 } 777 }
772 778
773 void addInterceptors(ClassElement cls) { 779 void addInterceptors(ClassElement cls) {
774 cls.ensureResolved(compiler); 780 cls.ensureResolved(compiler);
775 cls.forEachMember((ClassElement classElement, Element member) { 781 cls.forEachMember((ClassElement classElement, Element member) {
776 // TODO(ngeoffray): Support interceptors on Object methods. 782 // TODO(ngeoffray): Support interceptors on Object methods.
777 if (classElement == compiler.objectClass) return; 783 if (classElement == compiler.objectClass) return;
778 List<Element> list = interceptedElements.putIfAbsent( 784 List<Element> list = interceptedElements.putIfAbsent(
779 member.name, () => new List<Element>()); 785 member.name, () => new List<Element>());
780 list.add(member); 786 list.add(member);
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 print("Inferred return types:"); 1090 print("Inferred return types:");
1085 print("----------------------"); 1091 print("----------------------");
1086 dumpReturnTypes(); 1092 dumpReturnTypes();
1087 print(""); 1093 print("");
1088 print("Inferred field types:"); 1094 print("Inferred field types:");
1089 print("------------------------"); 1095 print("------------------------");
1090 fieldTypes.dump(); 1096 fieldTypes.dump();
1091 print(""); 1097 print("");
1092 } 1098 }
1093 } 1099 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698