Index: test/mjsunit/compiler/inline-arguments.js |
diff --git a/test/mjsunit/compiler/inline-arguments.js b/test/mjsunit/compiler/inline-arguments.js |
index b6adf7f6ccf308da4614ccdbfce3ffeff9472db9..d94c1e573c84982a202db87586907c3805f532fe 100644 |
--- a/test/mjsunit/compiler/inline-arguments.js |
+++ b/test/mjsunit/compiler/inline-arguments.js |
@@ -113,3 +113,35 @@ F4(1); |
%OptimizeFunctionOnNextCall(test_adaptation); |
test_adaptation(); |
})(); |
+ |
+// Test arguments access from the inlined function. |
+function uninlinable(v) { |
+ assertEquals(0, v); |
+ try { } catch (e) { } |
+ return 0; |
+} |
+ |
+function toarr_inner() { |
+ var a = arguments; |
+ var marker = a[0]; |
+ uninlinable(uninlinable(0, 0), marker.x); |
+ |
+ var r = new Array(); |
+ for (var i = a.length - 1; i >= 1; i--) { |
+ r.push(a[i]); |
+ } |
+ |
+ return r; |
+} |
+ |
+function toarr(marker, a, b, c) { |
+ return toarr_inner(marker, a/2, b/2, c/2); |
fschneider
2012/03/22 10:30:19
Please also add a test where inlining happens insi
Vyacheslav Egorov (Chromium)
2012/03/22 12:24:53
Done.
|
+} |
+ |
+var marker = { x: 0 }; |
+assertArrayEquals([3, 2, 1], toarr(marker, 2, 4, 6)); |
+assertArrayEquals([3, 2, 1], toarr(marker, 2, 4, 6)); |
+%OptimizeFunctionOnNextCall(toarr); |
+assertArrayEquals([3, 2, 1], toarr(marker, 2, 4, 6)); |
+delete marker.x; |
+assertArrayEquals([3, 2, 1], toarr(marker, 2, 4, 6)); |