Index: test/mjsunit/track-fields.js |
diff --git a/test/mjsunit/track-fields.js b/test/mjsunit/track-fields.js |
index 3176a5aed8f326d2808f080bbfafd2252c0acb1d..ced2bb3b67bf85faf67f2b24bfb949d5738cef53 100644 |
--- a/test/mjsunit/track-fields.js |
+++ b/test/mjsunit/track-fields.js |
@@ -99,3 +99,22 @@ assertFalse(%HaveSameMap(o6, o7)); |
// Smi, double, object. |
o6.c = {}; |
assertTrue(%HaveSameMap(o6, o7)); |
+ |
+function poly_load(o, b) { |
+ var v = o.field; |
+ if (b) { |
+ return v + 10; |
+ } |
+ return o; |
+} |
+ |
+var of1 = {a:0}; |
+of1.field = {}; |
+var of2 = {b:0}; |
+of2.field = 10; |
+ |
+poly_load(of1, false); |
+poly_load(of1, false); |
+poly_load(of2, true); |
+%OptimizeFunctionOnNextCall(poly_load); |
+assertEquals("[object Object]10", poly_load(of1, true)); |