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

Side by Side Diff: tests/language/vm/load_to_load_forwarding_vm_test.dart

Issue 189543013: Add alias identity information to array allocations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 | « runtime/vm/intermediate_language.h ('k') | no next file » | 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 // Test correctness of side effects tracking used by load to load forwarding. 4 // Test correctness of side effects tracking used by load to load forwarding.
5 5
6 // VMOptions=--optimization-counter-threshold=10 6 // VMOptions=--optimization-counter-threshold=10
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 import "dart:typed_data"; 9 import "dart:typed_data";
10 10
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 } 259 }
260 260
261 testIndexedAliasedStore2(a, b, i) { 261 testIndexedAliasedStore2(a, b, i) {
262 a[0] = 1; 262 a[0] = 1;
263 a[1] = 2; 263 a[1] = 2;
264 if (a == b) { 264 if (a == b) {
265 b[i] = 3; 265 b[i] = 3;
266 } 266 }
267 return a[0] + a[1]; 267 return a[0] + a[1];
268 } 268 }
269
270
271 testIndexedAliasedStore3(i) {
272 var a = new List(2);
273 a[0] = 1;
274 a[i] = 3;
275 return a[0];
276 }
277
278
279 testIndexedAliasedStore4(b) {
280 var a = new List(2);
281 a[0] = 1;
282 b[0] = 3;
283 return a[0];
284 }
285
286
269 var indices = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; 287 var indices = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
270 288
271 class Z { 289 class Z {
272 var x = 42; 290 var x = 42;
273 } 291 }
274 292
275 var global_array = new List<Z>(1); 293 var global_array = new List<Z>(1);
276 294
277 side_effect() { 295 side_effect() {
278 global_array[0].x++; 296 global_array[0].x++;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 final array = new List(3); 360 final array = new List(3);
343 for (var i = 0; i < 20; i++) { 361 for (var i = 0; i < 20; i++) {
344 Expect.equals(3, testIndexedNoAlias(array)); 362 Expect.equals(3, testIndexedNoAlias(array));
345 } 363 }
346 for (var i = 0; i < 20; i++) { 364 for (var i = 0; i < 20; i++) {
347 Expect.equals(5, testIndexedAliasedStore1(array, array)); 365 Expect.equals(5, testIndexedAliasedStore1(array, array));
348 } 366 }
349 for (var i = 0; i < 20; i++) { 367 for (var i = 0; i < 20; i++) {
350 Expect.equals(4, testIndexedAliasedStore2(array, array, indices[1])); 368 Expect.equals(4, testIndexedAliasedStore2(array, array, indices[1]));
351 } 369 }
370 for (var i = 0; i < 20; i++) {
371 Expect.equals(3, testIndexedAliasedStore3(indices[0]));
372 }
373 for (var i = 0; i < 20; i++) {
374 Expect.equals(1, testIndexedAliasedStore3(indices[1]));
375 }
376
377 for (var i = 0; i < 20; i++) {
378 Expect.equals(1, testIndexedAliasedStore4(array));
379 }
352 380
353 var test_array = new List(1); 381 var test_array = new List(1);
354 for (var i = 0; i < 20; i++) { 382 for (var i = 0; i < 20; i++) {
355 Expect.equals(43, testAliasingStoreIndexed(global_array)); 383 Expect.equals(43, testAliasingStoreIndexed(global_array));
356 } 384 }
357 } 385 }
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698