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

Unified Diff: tests/language/optimization_test.dart

Issue 18563006: More tests updated to optimize code (Part 2). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: tests/language/optimization_test.dart
===================================================================
--- tests/language/optimization_test.dart (revision 24922)
+++ tests/language/optimization_test.dart (working copy)
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Test various optimizations and deoptimizations of optimizing compiler..
+// VMOptions=--optimization-counter-threshold=10 --no-use-osr
import "package:expect/expect.dart";
@@ -46,16 +47,16 @@
}
main() {
- for (int i = 0; i < 2000; i++) {
+ for (int i = 0; i < 20; i++) {
Expect.stringEquals("HI 5", addThem(const StringPlus("HI "), 5).toString());
Expect.equals(true, isItInt(5));
}
Expect.equals(8, addThem(3, 5));
- for (int i = 0; i < 2000; i++) {
+ for (int i = 0; i < 20; i++) {
Expect.stringEquals("HI 5", addThem(const StringPlus("HI "), 5).toString());
Expect.equals(8, addThem(3, 5));
}
- for (int i = -500; i < 500; i++) {
+ for (int i = -10; i < 10; i++) {
var r = doNeg(i);
var p = doNeg(r);
Expect.equals(i, p);
@@ -66,16 +67,16 @@
var minInt = -(1 << 30);
Expect.equals(minInt, doNeg(doNeg(minInt)));
- for (int i = 0; i < 1000; i++) {
+ for (int i = 0; i < 20; i++) {
Expect.equals(false, doNot(true));
Expect.equals(true, doNot(doNot(true)));
}
- for (int i = 0; i < 1000; i++) {
+ for (int i = 0; i < 20; i++) {
Expect.equals(-57, doBitNot(56));
Expect.equals(55, doBitNot(-56));
}
- for (int i = 0; i < 2000; i++) {
+ for (int i = 0; i < 20; i++) {
Expect.equals(-2.2, doNeg2(2.2));
}
// Deoptimize.
@@ -84,7 +85,7 @@
var fixed = new List(10);
var growable = [1, 2, 3, 4, 5];
- for (int i = 0; i < 2000; i++) {
+ for (int i = 0; i < 20; i++) {
doStore1(fixed, 7);
Expect.equals(7, fixed[1]);
doStore2(growable, 12);

Powered by Google App Engine
This is Rietveld 408576698