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

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

Issue 2908153002: Revert "Fix misoptimization of 'is' test" (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 // Test that type tests are not misoptimized. 5 // Test that type tests are not misoptimized.
6 // VMOptions=--optimization-counter-threshold=1000 --optimization-filter=IsAnInt 6 // VMOptions=--optimization-counter-threshold=1000 --optimization-filter=IsAnInt
7 7
8 main() { 8 main() {
9 train(); 9 train();
10 if (IsAnInt("This is not an int")) throw "oops"; 10 if (IsAnInt("This is not an int")) throw "oops";
11 } 11 }
12 12
13 // Prime the IC with things that are and are not ints. 13 // Prime the IC with things that are and are not ints.
14 void train() { 14 void train() {
15 int sum = 0;
15 for (int i = 0; i < 10000; i++) { 16 for (int i = 0; i < 10000; i++) {
16 IsAnInt(42); // Smi - always goes first in the generated code. 17 IsAnInt(42); // Smi - always goes first in the generated code.
17 IsAnInt(1 << 62); // Mint on 64 bit platforms. 18 IsAnInt(1 << 62); // Mint on 64 bit platforms.
18 IsAnInt(1 << 62); 19 IsAnInt(1 << 62);
19 IsAnInt(4200000000000000000000000000000000000); // BigInt 20 IsAnInt(4200000000000000000000000000000000000); // BigInt
20 IsAnInt(4200000000000000000000000000000000000); 21 IsAnInt(4200000000000000000000000000000000000);
21 // This one that is not an int goes last in the IC because it is called 22 // This one that is not an int goes last in the IC because it is called
22 // less frequently. 23 // less frequently.
23 IsAnInt(4.2); 24 IsAnInt(4.2);
24 } 25 }
25 } 26 }
26 27
27 bool IsAnInt(f) => f is int; 28 int IsAnInt(Foo f) => f is int;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698