| 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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 new Map<Element, jsAst.Expression>(); | 635 new Map<Element, jsAst.Expression>(); |
| 636 | 636 |
| 637 ClassElement jsStringClass; | 637 ClassElement jsStringClass; |
| 638 ClassElement jsArrayClass; | 638 ClassElement jsArrayClass; |
| 639 ClassElement jsNumberClass; | 639 ClassElement jsNumberClass; |
| 640 ClassElement jsIntClass; | 640 ClassElement jsIntClass; |
| 641 ClassElement jsDoubleClass; | 641 ClassElement jsDoubleClass; |
| 642 ClassElement jsFunctionClass; | 642 ClassElement jsFunctionClass; |
| 643 ClassElement jsNullClass; | 643 ClassElement jsNullClass; |
| 644 ClassElement jsBoolClass; | 644 ClassElement jsBoolClass; |
| 645 ClassElement jsIndexableClass; |
| 645 Element jsArrayLength; | 646 Element jsArrayLength; |
| 646 Element jsStringLength; | 647 Element jsStringLength; |
| 647 Element jsArrayRemoveLast; | 648 Element jsArrayRemoveLast; |
| 648 Element jsArrayAdd; | 649 Element jsArrayAdd; |
| 649 Element jsStringSplit; | 650 Element jsStringSplit; |
| 650 Element jsStringConcat; | 651 Element jsStringConcat; |
| 651 Element jsStringToString; | 652 Element jsStringToString; |
| 652 Element getInterceptorMethod; | 653 Element getInterceptorMethod; |
| 653 Element interceptedNames; | 654 Element interceptedNames; |
| 654 Element fixedLengthListConstructor; | 655 Element fixedLengthListConstructor; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 // The int class must be before the double class, because the | 813 // The int class must be before the double class, because the |
| 813 // emitter relies on this list for the order of type checks. | 814 // emitter relies on this list for the order of type checks. |
| 814 jsIntClass = compiler.findInterceptor(const SourceString('JSInt')), | 815 jsIntClass = compiler.findInterceptor(const SourceString('JSInt')), |
| 815 jsDoubleClass = compiler.findInterceptor(const SourceString('JSDouble')), | 816 jsDoubleClass = compiler.findInterceptor(const SourceString('JSDouble')), |
| 816 jsNumberClass = compiler.findInterceptor(const SourceString('JSNumber')), | 817 jsNumberClass = compiler.findInterceptor(const SourceString('JSNumber')), |
| 817 jsNullClass = compiler.findInterceptor(const SourceString('JSNull')), | 818 jsNullClass = compiler.findInterceptor(const SourceString('JSNull')), |
| 818 jsFunctionClass = | 819 jsFunctionClass = |
| 819 compiler.findInterceptor(const SourceString('JSFunction')), | 820 compiler.findInterceptor(const SourceString('JSFunction')), |
| 820 jsBoolClass = compiler.findInterceptor(const SourceString('JSBool'))]; | 821 jsBoolClass = compiler.findInterceptor(const SourceString('JSBool'))]; |
| 821 | 822 |
| 823 jsIndexableClass = |
| 824 compiler.findInterceptor(const SourceString('JSIndexable')); |
| 825 |
| 822 jsArrayClass.ensureResolved(compiler); | 826 jsArrayClass.ensureResolved(compiler); |
| 823 jsArrayLength = compiler.lookupElementIn( | 827 jsArrayLength = compiler.lookupElementIn( |
| 824 jsArrayClass, const SourceString('length')); | 828 jsArrayClass, const SourceString('length')); |
| 825 jsArrayRemoveLast = compiler.lookupElementIn( | 829 jsArrayRemoveLast = compiler.lookupElementIn( |
| 826 jsArrayClass, const SourceString('removeLast')); | 830 jsArrayClass, const SourceString('removeLast')); |
| 827 jsArrayAdd = compiler.lookupElementIn( | 831 jsArrayAdd = compiler.lookupElementIn( |
| 828 jsArrayClass, const SourceString('add')); | 832 jsArrayClass, const SourceString('add')); |
| 829 | 833 |
| 830 jsStringClass.ensureResolved(compiler); | 834 jsStringClass.ensureResolved(compiler); |
| 831 jsStringLength = compiler.lookupElementIn( | 835 jsStringLength = compiler.lookupElementIn( |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1507 assert(invariant(element, element.isDeclaration)); | 1511 assert(invariant(element, element.isDeclaration)); |
| 1508 generatedCode.remove(element); | 1512 generatedCode.remove(element); |
| 1509 generatedBailoutCode.remove(element); | 1513 generatedBailoutCode.remove(element); |
| 1510 compiler.enqueuer.codegen.addToWorkList(element); | 1514 compiler.enqueuer.codegen.addToWorkList(element); |
| 1511 } | 1515 } |
| 1512 | 1516 |
| 1513 bool isNullImplementation(ClassElement cls) { | 1517 bool isNullImplementation(ClassElement cls) { |
| 1514 return cls == jsNullClass; | 1518 return cls == jsNullClass; |
| 1515 } | 1519 } |
| 1516 } | 1520 } |
| OLD | NEW |