Index: test/mjsunit/compiler/inline-arguments.js |
diff --git a/test/mjsunit/compiler/inline-arguments.js b/test/mjsunit/compiler/inline-arguments.js |
index 1337ab237a4cadd8a053e6e95d0d58ffff717ccb..d52f31b5e9171fa22e248720e8d36c6bc976072c 100644 |
--- a/test/mjsunit/compiler/inline-arguments.js |
+++ b/test/mjsunit/compiler/inline-arguments.js |
@@ -309,3 +309,29 @@ test_toarr(toarr2); |
delete forceDeopt.deopt; |
outer(); |
})(); |
+ |
+ |
+// Test inlining of functions with %_Arguments and %_ArgumentsLength intrinsic. |
+(function () { |
+ function inner(len,a,b,c) { |
+ assertSame(len, %_ArgumentsLength()); |
+ for (var i = 1; i < len; ++i) { |
+ var c = String.fromCharCode(96 + i); |
+ assertSame(c, %_Arguments(i)); |
+ } |
+ } |
+ |
+ function outer() { |
+ inner(1); |
+ inner(2, 'a'); |
+ inner(3, 'a', 'b'); |
+ inner(4, 'a', 'b', 'c'); |
+ inner(5, 'a', 'b', 'c', 'd'); |
+ inner(6, 'a', 'b', 'c', 'd', 'e'); |
+ } |
+ |
+ outer(); |
+ outer(); |
+ %OptimizeFunctionOnNextCall(outer); |
+ outer(); |
+})(); |