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

Unified Diff: test/mjsunit/sum-0-plus-undefined-is-NaN.js

Issue 6821009: Introduce runtime function %OptimizeFunctionOnNextCall to manually trigger optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/string-charcodeat.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/sum-0-plus-undefined-is-NaN.js
diff --git a/test/mjsunit/sum-0-plus-undefined-is-NaN.js b/test/mjsunit/sum-0-plus-undefined-is-NaN.js
index fb98d0cfee6977b217ba8273ae76c6ca2aecb576..5d662d1dc671eb4f6ab1f20026269c935008071c 100644
--- a/test/mjsunit/sum-0-plus-undefined-is-NaN.js
+++ b/test/mjsunit/sum-0-plus-undefined-is-NaN.js
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Flags: --allow-natives-syntax
+
/**
* @fileoverview Test addition of 0 and undefined.
*/
@@ -32,9 +34,11 @@
function sum(a, b) { return a + b; }
function test(x, y, expectNaN) {
- for (var i = 0; i < 1000; i++) {
+ for (var i = 0; i < 5; i++) {
assertEquals(expectNaN, isNaN(sum(x, y)));
}
+ %OptimizeFunctionOnNextCall(sum);
+ assertEquals(expectNaN, isNaN(sum(x, y)));
}
test(0, 1, false);
« no previous file with comments | « test/mjsunit/string-charcodeat.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698