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

Unified Diff: test/mjsunit/math-min-max.js

Issue 2814050: Version 2.2.23... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 10 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
« no previous file with comments | « test/mjsunit/fuzz-natives.js ('k') | test/mjsunit/string-replace-with-empty.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/math-min-max.js
===================================================================
--- test/mjsunit/math-min-max.js (revision 5030)
+++ test/mjsunit/math-min-max.js (working copy)
@@ -42,7 +42,16 @@
// Prepare a non-Smi zero value.
function returnsNonSmi(){ return 0.25; }
-var ZERO = returnsNonSmi() - returnsNonSmi();
+var ZERO = (function() {
+ var z;
+ // We have to have a loop here because the first time we get a Smi from the
+ // runtime system. After a while the binary op IC settles down and we get
+ // a non-Smi from the generated code.
+ for (var i = 0; i < 10; i++) {
+ z = returnsNonSmi() - returnsNonSmi();
+ }
+ return z;
+})();
assertEquals(0, ZERO);
assertEquals(Infinity, 1/ZERO);
assertEquals(-Infinity, 1/-ZERO);
« no previous file with comments | « test/mjsunit/fuzz-natives.js ('k') | test/mjsunit/string-replace-with-empty.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698