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

Side by Side Diff: tests/standalone/int_array_deopt.dart

Issue 14426006: Rename dart:typeddata to dart:typed_data. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // 4 //
5 // Dart deoptimization of Uint32Array and Int32Array loads. 5 // Dart deoptimization of Uint32Array and Int32Array loads.
6 6
7 import 'dart:typeddata'; 7 import 'dart:typed_data';
8 8
9 loadI32(a) => a[0] + 1; 9 loadI32(a) => a[0] + 1;
10 loadUi32(a) => a[0] + 1; 10 loadUi32(a) => a[0] + 1;
11 11
12 main() { 12 main() {
13 var i32 = new Int32List(10); 13 var i32 = new Int32List(10);
14 var ui32 = new Uint32List(10); 14 var ui32 = new Uint32List(10);
15 i32[0] = ui32[0] = 8; 15 i32[0] = ui32[0] = 8;
16 // Optimize loadI32 and LoadUi32 for Smi result of indexed load. 16 // Optimize loadI32 and LoadUi32 for Smi result of indexed load.
17 for (int i = 0; i < 2000; i++) { 17 for (int i = 0; i < 2000; i++) {
18 Expect.equals(9, loadI32(i32)); 18 Expect.equals(9, loadI32(i32));
19 Expect.equals(9, loadUi32(ui32)); 19 Expect.equals(9, loadUi32(ui32));
20 } 20 }
21 // On ia32, deoptimize when attempting to load a value that exceeds 21 // On ia32, deoptimize when attempting to load a value that exceeds
22 // Smi range. 22 // Smi range.
23 i32[0] = ui32[0] = 2147483647; 23 i32[0] = ui32[0] = 2147483647;
24 Expect.equals(2147483648, loadI32(i32)); 24 Expect.equals(2147483648, loadI32(i32));
25 Expect.equals(2147483648, loadUi32(ui32)); 25 Expect.equals(2147483648, loadUi32(ui32));
26 // Reoptimize again, but this time assume mixed Smi/Mint results 26 // Reoptimize again, but this time assume mixed Smi/Mint results
27 i32[0] = ui32[0] = 10; 27 i32[0] = ui32[0] = 10;
28 for (int i = 0; i < 2000; i++) { 28 for (int i = 0; i < 2000; i++) {
29 Expect.equals(11, loadI32(i32)); 29 Expect.equals(11, loadI32(i32));
30 Expect.equals(11, loadUi32(ui32)); 30 Expect.equals(11, loadUi32(ui32));
31 } 31 }
32 } 32 }
OLDNEW
« no previous file with comments | « tests/standalone/float_array_test.dart ('k') | tests/standalone/int_array_load_elimination_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698