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

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

Issue 155113002: Revert "Fix for issue 16497 - fix load elimination aliasing for typed arrays" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 class JavaScriptItemCompilationContext extends ItemCompilationContext { 9 class JavaScriptItemCompilationContext extends ItemCompilationContext {
10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>();
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 bool isTypedArray(TypeMask mask) { 1731 bool isTypedArray(TypeMask mask) {
1732 // Just checking for [:TypedData:] is not sufficient, as it is an 1732 // Just checking for [:TypedData:] is not sufficient, as it is an
1733 // abstract class any user-defined class can implement. So we also 1733 // abstract class any user-defined class can implement. So we also
1734 // check for the interface [JavaScriptIndexingBehavior]. 1734 // check for the interface [JavaScriptIndexingBehavior].
1735 return compiler.typedDataClass != null 1735 return compiler.typedDataClass != null
1736 && mask.satisfies(compiler.typedDataClass, compiler) 1736 && mask.satisfies(compiler.typedDataClass, compiler)
1737 && mask.satisfies(jsIndexingBehaviorInterface, compiler); 1737 && mask.satisfies(jsIndexingBehaviorInterface, compiler);
1738 } 1738 }
1739 1739
1740 bool couldBeTypedArray(TypeMask mask) { 1740 bool couldBeTypedArray(TypeMask mask) {
1741 bool intersects(TypeMask type1, TypeMask type2) => 1741 TypeMask indexing = new TypeMask.subtype(jsIndexingBehaviorInterface);
1742 !type1.intersection(type2, compiler).isEmpty; 1742 // Checking if [mask] contains [indexing] means that we want to
1743 1743 // know if [mask] is not a more specific type than [indexing].
1744 return compiler.typedDataClass != null 1744 return isTypedArray(mask) || mask.containsMask(indexing, compiler);
1745 && intersects(mask, new TypeMask.subtype(compiler.typedDataClass))
1746 && intersects(mask, new TypeMask.subtype(jsIndexingBehaviorInterface));
1747 } 1745 }
1748 1746
1749 /// Returns all static fields that are referenced through [targetsUsed]. 1747 /// Returns all static fields that are referenced through [targetsUsed].
1750 /// If the target is a library or class all nested static fields are 1748 /// If the target is a library or class all nested static fields are
1751 /// included too. 1749 /// included too.
1752 Iterable<Element> _findStaticFieldTargets() { 1750 Iterable<Element> _findStaticFieldTargets() {
1753 List staticFields = []; 1751 List staticFields = [];
1754 1752
1755 void addFieldsInContainer(ScopeContainerElement container) { 1753 void addFieldsInContainer(ScopeContainerElement container) {
1756 container.forEachLocalMember((Element member) { 1754 container.forEachLocalMember((Element member) {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1909 copy(constant.values); 1907 copy(constant.values);
1910 copy(constant.protoValue); 1908 copy(constant.protoValue);
1911 copy(constant); 1909 copy(constant);
1912 } 1910 }
1913 1911
1914 void visitConstructed(ConstructedConstant constant) { 1912 void visitConstructed(ConstructedConstant constant) {
1915 copy(constant.fields); 1913 copy(constant.fields);
1916 copy(constant); 1914 copy(constant);
1917 } 1915 }
1918 } 1916 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698