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

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

Issue 155123002: Redo "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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 35abf1ce879121bac08a65ded890548d4548ad89..36ddfa55cd3ca54374ce24368dfc1ac24e4d4d9a 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -1738,10 +1738,12 @@ class JavaScriptBackend extends Backend {
}
bool couldBeTypedArray(TypeMask mask) {
- TypeMask indexing = new TypeMask.subtype(jsIndexingBehaviorInterface);
- // Checking if [mask] contains [indexing] means that we want to
- // know if [mask] is not a more specific type than [indexing].
- return isTypedArray(mask) || mask.containsMask(indexing, compiler);
+ bool intersects(TypeMask type1, TypeMask type2) =>
+ !type1.intersection(type2, compiler).isEmpty;
+
+ return compiler.typedDataClass != null
+ && intersects(mask, new TypeMask.subtype(compiler.typedDataClass))
+ && intersects(mask, new TypeMask.subtype(jsIndexingBehaviorInterface));
}
/// Returns all static fields that are referenced through [targetsUsed].
« 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