Chromium Code Reviews| 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..d063eaf520011ecdb4670421124c114e176e6a5a 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; // lower 32bits are all 0s |
|
Florian Schneider
2015/01/26 13:30:39
Comment: Should not be forwarded.
Vyacheslav Egorov (Google)
2015/01/26 14:57:16
Done.
|
| + 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; |
|
Florian Schneider
2015/01/26 13:30:39
Comment: Should be forwarded.
Vyacheslav Egorov (Google)
2015/01/26 14:57:16
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; |
|
Florian Schneider
2015/01/26 13:30:39
Comment: Should be forwarded, [0,7] and [14], [15]
Vyacheslav Egorov (Google)
2015/01/26 14:57:16
note: view starts at 8 - means f64[0] is bytes 8-1
|
| + 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. |
|
Florian Schneider
2015/01/26 13:30:39
This should not be forwarded, since f64[0] writes
Vyacheslav Egorov (Google)
2015/01/26 14:57:16
note: view starts at 8 like about. should *be* for
|
| + 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()); |
| + } |
| } |