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

Unified Diff: tests/language/vm/load_to_load_forwarding_vm_test.dart

Issue 868283002: Fix LoadOptimizer's handling of load/stores with constant indices for TypedData. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | « tests/language/language.status ('k') | tests/language/vm/load_to_load_unaligned_forwarding_vm_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/vm/load_to_load_forwarding_vm_test.dart
diff --git a/tests/language/vm/load_to_load_forwarding_vm_test.dart b/tests/language/vm/load_to_load_forwarding_vm_test.dart
index 7da5fd26ae918ec822d47f4a7d0562a47181526b..f97e662df79dd8de337138c00795ab2928e0efc3 100644
--- a/tests/language/vm/load_to_load_forwarding_vm_test.dart
+++ b/tests/language/vm/load_to_load_forwarding_vm_test.dart
@@ -486,6 +486,40 @@ testAliasesRefinement() {
return b.f;
}
+testViewAliasing1() {
+ final f64 = new Float64List(1);
+ final f32 = new Float32List.view(f64.buffer);
+ f64[0] = 1.0; // Should not be forwarded.
+ f32[1] = 2.0; // upper 32bits for 2.0f and 2.0 are the same
+ return f64[0];
+}
+
+testViewAliasing2() {
+ final f64 = new Float64List(2);
+ final f64v = new Float64List.view(f64.buffer, Float64List.BYTES_PER_ELEMENT);
+ f64[1] = 1.0; // Should not be forwarded.
+ f64v[0] = 2.0;
+ return f64[1];
+}
+
+testViewAliasing3() {
+ final u8 = new Uint8List(Float64List.BYTES_PER_ELEMENT * 2);
+ final f64 = new Float64List.view(u8.buffer, Float64List.BYTES_PER_ELEMENT);
+ f64[0] = 1.0; // Should not be forwarded.
+ u8[15] = 0x40;
+ u8[14] = 0x00;
+ return f64[0];
+}
+
+testViewAliasing4() {
+ final u8 = new Uint8List(Float64List.BYTES_PER_ELEMENT * 2);
+ final f64 = new Float64List.view(u8.buffer, Float64List.BYTES_PER_ELEMENT);
+ f64[0] = 2.0; // Not aliased: should be forwarded.
+ u8[0] = 0x40;
+ u8[1] = 0x00;
+ return f64[0];
+}
+
main() {
final fixed = new List(10);
final growable = [];
@@ -552,4 +586,11 @@ main() {
for (var i = 0; i < 20; i++) {
Expect.equals(43, testAliasingStoreIndexed(global_array));
}
+
+ for (var i = 0; i < 20; i++) {
+ Expect.equals(2.0, testViewAliasing1());
+ Expect.equals(2.0, testViewAliasing2());
+ Expect.equals(2.0, testViewAliasing3());
+ Expect.equals(2.0, testViewAliasing4());
+ }
}
« no previous file with comments | « tests/language/language.status ('k') | tests/language/vm/load_to_load_unaligned_forwarding_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698