Index: test/mjsunit/math-min-max.js |
diff --git a/test/mjsunit/math-min-max.js b/test/mjsunit/math-min-max.js |
index e4fd313538f53270747661268a1a1d47dfbc7c39..a4d1b27c70b39a58e0a450e410cb45274e701867 100644 |
--- a/test/mjsunit/math-min-max.js |
+++ b/test/mjsunit/math-min-max.js |
@@ -177,6 +177,21 @@ function crankshaft_test_2() { |
run(crankshaft_test_2); |
+var o = { a: 1, b: 2 }; |
+ |
+// Test smi-based Math.min. |
+function f(o) { |
+ return Math.min(o.a, o.b); |
+} |
+ |
+assertEquals(1, f(o)); |
+assertEquals(1, f(o)); |
+%OptimizeFunctionOnNextCall(f); |
+assertEquals(1, f(o)); |
+o.a = 5; |
+o.b = 4; |
+assertEquals(4, f(o)); |
+ |
// Test overriding Math.min and Math.max |
Math.min = function(a, b) { return a + b; } |
Math.max = function(a, b) { return a - b; } |