Chromium Code Reviews| Index: test/mjsunit/compiler/inline-arguments.js |
| diff --git a/test/mjsunit/compiler/inline-arguments.js b/test/mjsunit/compiler/inline-arguments.js |
| index 532fc26a17ec504f88d2aa47edf05a4858814ce4..b79f59c4a16e0bc4c28c2ecf8bcff53a1e478d26 100644 |
| --- a/test/mjsunit/compiler/inline-arguments.js |
| +++ b/test/mjsunit/compiler/inline-arguments.js |
| @@ -27,11 +27,30 @@ |
| // Flags: --allow-natives-syntax |
| -// Test inlining functions that use arguments. |
| -function f() { return g(1, 2, 3); } |
| +function A() { |
| +} |
| -function g(x, y, z) { return %_ArgumentsLength(); } |
| +A.prototype.X = function (a, b, c) { |
| + assertTrue(this instanceof A); |
|
fschneider
2012/03/12 10:13:32
Maybe also add a test where the receiver is wrappe
|
| + assertEquals(1, a); |
| + assertEquals(2, b); |
| + assertEquals(3, c); |
| +}; |
| -for (var i = 0; i < 5; ++i) f(); |
| -%OptimizeFunctionOnNextCall(f); |
| -assertEquals(3, f()); |
| +A.prototype.Y = function () { |
| + this.X.apply(this, arguments); |
| +}; |
| + |
| +A.prototype.Z = function () { |
| + this.Y(1,2,3); |
| +}; |
| + |
| +var a = new A(); |
| +a.Z(4,5,6); |
| +a.Z(4,5,6); |
| +%OptimizeFunctionOnNextCall(a.Z); |
| +a.Z(4,5,6); |
| +A.prototype.X.apply = function (receiver, args) { |
| + return Function.prototype.apply.call(this, receiver, args); |
| +}; |
| +a.Z(4,5,6); |