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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/backend.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index 96fe78738dc144d18a5e7e87e7e3f04b4a061ee3..cd961728012fa07b1e80e55a294c1623ac551b27 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -1706,22 +1706,14 @@ class MemorySet {
MemorySet(this.compiler);
/**
- * Returns whether [first] and [second] always alias to the same object.
- */
- bool mustAlias(HInstruction first, HInstruction second) {
- return first == second;
- }
-
- /**
- * Returns whether [first] and [second] may alias to the same object.
+ * Returns whether [first] and [second] may alias to the same
+ * object.
*/
bool mayAlias(HInstruction first, HInstruction second) {
- if (mustAlias(first, second)) return true;
+ if (first == second) return true;
if (isConcrete(first) && isConcrete(second)) return false;
if (nonEscapingReceivers.contains(first)) return false;
if (nonEscapingReceivers.contains(second)) return false;
- // Typed arrays of different types might have a shared buffer.
- if (couldBeTypedArray(first) && couldBeTypedArray(second)) return true;
TypeMask intersection = first.instructionType.intersection(
second.instructionType, compiler);
if (intersection.isEmpty) return false;
@@ -1738,10 +1730,6 @@ class MemorySet {
|| instruction is HLiteralList;
}
- bool couldBeTypedArray(HInstruction receiver) {
- return compiler.backend.couldBeTypedArray(receiver.instructionType);
- }
-
/**
* Returns whether [receiver] escapes the current function.
*/
@@ -1861,19 +1849,15 @@ class MemorySet {
nonEscapingReceivers.remove(value);
keyedValues.forEach((key, values) {
if (mayAlias(receiver, key)) {
- // Typed arrays that are views of the same buffer may have different
- // offsets or element sizes, unless they are the same typed array.
- bool weakIndex = couldBeTypedArray(key) && !mustAlias(receiver, key);
values.forEach((otherIndex, otherValue) {
- if (weakIndex || mayAlias(index, otherIndex)) {
- values[otherIndex] = null;
- }
+ if (mayAlias(index, otherIndex)) values[otherIndex] = null;
});
}
});
+ JavaScriptBackend backend = compiler.backend;
// Typed arrays may narrow incoming values.
- if (couldBeTypedArray(receiver)) return;
+ if (backend.couldBeTypedArray(receiver.instructionType)) return;
Map<HInstruction, HInstruction> map = keyedValues.putIfAbsent(
receiver, () => <HInstruction, HInstruction> {});
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/backend.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698