Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 ClassElement jsArrayClass; | 627 ClassElement jsArrayClass; |
| 628 ClassElement jsNumberClass; | 628 ClassElement jsNumberClass; |
| 629 ClassElement jsIntClass; | 629 ClassElement jsIntClass; |
| 630 ClassElement jsDoubleClass; | 630 ClassElement jsDoubleClass; |
| 631 ClassElement jsFunctionClass; | 631 ClassElement jsFunctionClass; |
| 632 ClassElement jsNullClass; | 632 ClassElement jsNullClass; |
| 633 ClassElement jsBoolClass; | 633 ClassElement jsBoolClass; |
| 634 ClassElement objectInterceptorClass; | 634 ClassElement objectInterceptorClass; |
| 635 Element jsArrayLength; | 635 Element jsArrayLength; |
| 636 Element jsStringLength; | 636 Element jsStringLength; |
| 637 Element jsArrayRemoveLast; | |
| 638 Element jsArrayAdd; | |
| 639 Element jsStringSplit; | |
| 640 Element jsStringConcat; | |
| 637 Element getInterceptorMethod; | 641 Element getInterceptorMethod; |
| 638 bool _interceptorsAreInitialized = false; | 642 bool _interceptorsAreInitialized = false; |
| 639 | 643 |
| 640 final Namer namer; | 644 final Namer namer; |
| 641 | 645 |
| 642 /** | 646 /** |
| 643 * Interface used to determine if an object has the JavaScript | 647 * Interface used to determine if an object has the JavaScript |
| 644 * indexing behavior. The interface is only visible to specific | 648 * indexing behavior. The interface is only visible to specific |
| 645 * libraries. | 649 * libraries. |
| 646 */ | 650 */ |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 765 jsIntClass = compiler.findInterceptor(const SourceString('JSInt')), | 769 jsIntClass = compiler.findInterceptor(const SourceString('JSInt')), |
| 766 jsDoubleClass = compiler.findInterceptor(const SourceString('JSDouble')), | 770 jsDoubleClass = compiler.findInterceptor(const SourceString('JSDouble')), |
| 767 jsNullClass = compiler.findInterceptor(const SourceString('JSNull')), | 771 jsNullClass = compiler.findInterceptor(const SourceString('JSNull')), |
| 768 jsFunctionClass = | 772 jsFunctionClass = |
| 769 compiler.findInterceptor(const SourceString('JSFunction')), | 773 compiler.findInterceptor(const SourceString('JSFunction')), |
| 770 jsBoolClass = compiler.findInterceptor(const SourceString('JSBool'))]; | 774 jsBoolClass = compiler.findInterceptor(const SourceString('JSBool'))]; |
| 771 | 775 |
| 772 jsArrayClass.ensureResolved(compiler); | 776 jsArrayClass.ensureResolved(compiler); |
| 773 jsArrayLength = | 777 jsArrayLength = |
| 774 jsArrayClass.lookupLocalMember(const SourceString('length')); | 778 jsArrayClass.lookupLocalMember(const SourceString('length')); |
| 779 jsArrayRemoveLast = | |
| 780 jsArrayClass.lookupLocalMember(const SourceString('removeLast')); | |
|
ahe
2012/11/30 08:11:42
I think you need to check that you can actually fi
| |
| 781 jsArrayAdd = | |
| 782 jsArrayClass.lookupLocalMember(const SourceString('add')); | |
| 775 | 783 |
| 776 jsStringClass.ensureResolved(compiler); | 784 jsStringClass.ensureResolved(compiler); |
| 777 jsStringLength = | 785 jsStringLength = |
| 778 jsStringClass.lookupLocalMember(const SourceString('length')); | 786 jsStringClass.lookupLocalMember(const SourceString('length')); |
| 787 jsStringSplit = | |
| 788 jsStringClass.lookupLocalMember(const SourceString('split')); | |
| 789 jsStringConcat = | |
| 790 jsStringClass.lookupLocalMember(const SourceString('concat')); | |
| 779 | 791 |
| 780 for (ClassElement cls in classes) { | 792 for (ClassElement cls in classes) { |
| 781 if (cls != null) interceptedClasses[cls] = null; | 793 if (cls != null) interceptedClasses[cls] = null; |
| 782 } | 794 } |
| 783 } | 795 } |
| 784 | 796 |
| 785 void addInterceptors(ClassElement cls) { | 797 void addInterceptors(ClassElement cls) { |
| 786 cls.ensureResolved(compiler); | 798 cls.ensureResolved(compiler); |
| 787 cls.forEachMember((ClassElement classElement, Element member) { | 799 cls.forEachMember((ClassElement classElement, Element member) { |
| 788 Set<Element> set = interceptedElements.putIfAbsent( | 800 Set<Element> set = interceptedElements.putIfAbsent( |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1104 print("Inferred return types:"); | 1116 print("Inferred return types:"); |
| 1105 print("----------------------"); | 1117 print("----------------------"); |
| 1106 dumpReturnTypes(); | 1118 dumpReturnTypes(); |
| 1107 print(""); | 1119 print(""); |
| 1108 print("Inferred field types:"); | 1120 print("Inferred field types:"); |
| 1109 print("------------------------"); | 1121 print("------------------------"); |
| 1110 fieldTypes.dump(); | 1122 fieldTypes.dump(); |
| 1111 print(""); | 1123 print(""); |
| 1112 } | 1124 } |
| 1113 } | 1125 } |
| OLD | NEW |