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

Side by Side Diff: tests/language/src/OptimizationTest.dart

Issue 8996024: Fix a bug in intrinsified Array_setIndexed type check. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 various optimizations and deoptimizations of optimizing compiler.. 4 // Test various optimizations and deoptimizations of optimizing compiler..
5 5
6 addThem(a, b) { 6 addThem(a, b) {
7 return a + b; 7 return a + b;
8 } 8 }
9 9
10 isItInt(a) { 10 isItInt(a) {
11 return a is int; 11 return a is int;
12 } 12 }
13 13
14 doNeg(a) { 14 doNeg(a) {
15 return -a; 15 return -a;
16 } 16 }
17 17
18 doNeg2(a) {
19 return -a;
20 }
21
18 doNot(a) { 22 doNot(a) {
19 return !a; 23 return !a;
20 } 24 }
21 25
22 doBitNot(a) { 26 doBitNot(a) {
23 return ~a; 27 return ~a;
24 } 28 }
25 29
26 main() { 30 main() {
27 for (int i = 0; i < 2000; i++) { 31 for (int i = 0; i < 2000; i++) {
(...skipping 17 matching lines...) Expand all
45 Expect.equals(minInt, doNeg(doNeg(minInt))); 49 Expect.equals(minInt, doNeg(doNeg(minInt)));
46 50
47 for (int i = 0; i < 1000; i++) { 51 for (int i = 0; i < 1000; i++) {
48 Expect.equals(false, doNot(true)); 52 Expect.equals(false, doNot(true));
49 Expect.equals(true, doNot(doNot(true))); 53 Expect.equals(true, doNot(doNot(true)));
50 } 54 }
51 for (int i = 0; i < 1000; i++) { 55 for (int i = 0; i < 1000; i++) {
52 Expect.equals(-57, doBitNot(56)); 56 Expect.equals(-57, doBitNot(56));
53 Expect.equals(55, doBitNot(-56)); 57 Expect.equals(55, doBitNot(-56));
54 } 58 }
59
60 for (int i = 0; i < 2000; i++) {
61 Expect.equals(-2.2, doNeg2(2.2));
62 }
63 // Deoptimize.
64 Expect.equals(-5, doNeg2(5));
55 } 65 }
OLDNEW
« runtime/vm/opt_code_generator_ia32.cc ('K') | « runtime/vm/opt_code_generator_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698