Index: test/mjsunit/math-min-max.js |
=================================================================== |
--- test/mjsunit/math-min-max.js (revision 5022) |
+++ 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); |