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

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

Issue 966773002: VM: Better type propagation for string objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comment and fixed MaybeNumber Created 5 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.cc ('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) 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 // Test various optimizations and deoptimizations of optimizing compiler.. 4 // Test various optimizations and deoptimizations of optimizing compiler..
5 // VMOptions=--optimization-counter-threshold=10 --no-constant-propagation 5 // VMOptions=--optimization-counter-threshold=10 --no-constant-propagation
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 // Test canonicalization of identical with double input. 9 // Test canonicalization of identical with double input.
10 // Constant propagation is disabled so that canonicalization is run 10 // Constant propagation is disabled so that canonicalization is run
11 // one time less than usual. 11 // one time less than usual.
12 12
13 test(a) { 13 test(a) {
14 var dbl = a + 1.0; 14 var dbl = a + 1.0;
15 if (!identical(dbl, true)) { 15 if (!identical(dbl, true)) {
16 return "ok"; 16 return "ok";
17 } 17 }
18 throw "fail"; 18 throw "fail";
19 } 19 }
20 20
21 Object Y = 1.0;
22
23 test_object_type(x) => identical(x, Y);
24
21 main() { 25 main() {
22 for (var i = 0; i < 20; i++) test(0); 26 for (var i = 0; i < 20; i++) test(0);
23 Expect.equals("ok", test(0)); 27 Expect.equals("ok", test(0));
28
29 var x = 0.0 + 1.0;
30 for (var i = 0; i < 20; i++) test_object_type(x);
31 Expect.equals(true, test_object_type(x));
24 } 32 }
25 33
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698