| 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 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 7 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 8 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); | 8 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); |
| 9 final Set<HInstruction> allocatedFixedLists = new Set<HInstruction>(); | 9 final Set<HInstruction> allocatedFixedLists = new Set<HInstruction>(); |
| 10 } | 10 } |
| (...skipping 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 | 1825 |
| 1826 bool isTypedArray(TypeMask mask) { | 1826 bool isTypedArray(TypeMask mask) { |
| 1827 // Just checking for [:TypedData:] is not sufficient, as it is an | 1827 // Just checking for [:TypedData:] is not sufficient, as it is an |
| 1828 // abstract class any user-defined class can implement. So we also | 1828 // abstract class any user-defined class can implement. So we also |
| 1829 // check for the interface [JavaScriptIndexingBehavior]. | 1829 // check for the interface [JavaScriptIndexingBehavior]. |
| 1830 return compiler.typedDataClass != null | 1830 return compiler.typedDataClass != null |
| 1831 && mask.satisfies(compiler.typedDataClass, compiler) | 1831 && mask.satisfies(compiler.typedDataClass, compiler) |
| 1832 && mask.satisfies(jsIndexingBehaviorInterface, compiler); | 1832 && mask.satisfies(jsIndexingBehaviorInterface, compiler); |
| 1833 } | 1833 } |
| 1834 | 1834 |
| 1835 bool couldBeTypedArray(TypeMask mask) { |
| 1836 TypeMask indexing = new TypeMask.subtype(jsIndexingBehaviorInterface); |
| 1837 // Checking if [mask] contains [indexing] means that we want to |
| 1838 // know if [mask] is not a more specific type than [indexing]. |
| 1839 return isTypedArray(mask) || mask.containsMask(indexing, compiler); |
| 1840 } |
| 1841 |
| 1835 /// Called when [enqueuer] is empty, but before it is closed. | 1842 /// Called when [enqueuer] is empty, but before it is closed. |
| 1836 void onQueueEmpty(Enqueuer enqueuer) { | 1843 void onQueueEmpty(Enqueuer enqueuer) { |
| 1837 if (!enqueuer.isResolutionQueue && preMirrorsMethodCount == 0) { | 1844 if (!enqueuer.isResolutionQueue && preMirrorsMethodCount == 0) { |
| 1838 preMirrorsMethodCount = generatedCode.length; | 1845 preMirrorsMethodCount = generatedCode.length; |
| 1839 } | 1846 } |
| 1840 | 1847 |
| 1841 if (isTreeShakingDisabled) enqueuer.enqueueEverything(); | 1848 if (isTreeShakingDisabled) enqueuer.enqueueEverything(); |
| 1842 | 1849 |
| 1843 if (mustPreserveNames) compiler.log('Preserving names.'); | 1850 if (mustPreserveNames) compiler.log('Preserving names.'); |
| 1844 | 1851 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 copy(constant.values); | 1920 copy(constant.values); |
| 1914 copy(constant.protoValue); | 1921 copy(constant.protoValue); |
| 1915 copy(constant); | 1922 copy(constant); |
| 1916 } | 1923 } |
| 1917 | 1924 |
| 1918 void visitConstructed(ConstructedConstant constant) { | 1925 void visitConstructed(ConstructedConstant constant) { |
| 1919 copy(constant.fields); | 1926 copy(constant.fields); |
| 1920 copy(constant); | 1927 copy(constant); |
| 1921 } | 1928 } |
| 1922 } | 1929 } |
| OLD | NEW |