| Index: test/mjsunit/regress/regress-param-local-type.js
|
| diff --git a/test/mjsunit/regress/regress-store-uncacheable.js b/test/mjsunit/regress/regress-param-local-type.js
|
| similarity index 77%
|
| copy from test/mjsunit/regress/regress-store-uncacheable.js
|
| copy to test/mjsunit/regress/regress-param-local-type.js
|
| index e9c9fc25b49c95293a5c0acea0bea8d073a79e0e..bf260900898923a5fe2471aed82eb9ce5f896bf2 100644
|
| --- a/test/mjsunit/regress/regress-store-uncacheable.js
|
| +++ b/test/mjsunit/regress/regress-param-local-type.js
|
| @@ -27,14 +27,32 @@
|
|
|
| // Flags: --allow-natives-syntax
|
|
|
| -function f() {
|
| - var o = {};
|
| - o["<abc>"] = 123;
|
| +// Test that we do not confuse the first local and the first parameter
|
| +// when gathering type information.
|
| +
|
| +function f(a) { // First parameter is tagged.
|
| + var s = ''; // First local has string type.
|
| + var n = 0;
|
| + var i = 1;
|
| + n = i + a;
|
| }
|
|
|
| -f();
|
| -f();
|
| -f();
|
| +f(1);
|
| +f(1);
|
| %OptimizeFunctionOnNextCall(f);
|
| -f();
|
| +f(1);
|
| assertOptimized(f);
|
| +
|
| +
|
| +function g() { // 0th parameter (receiver) is tagged.
|
| + var s = ''; // First local has string type.
|
| + var n = 0;
|
| + var i = 1;
|
| + n = i + this;
|
| +}
|
| +
|
| +g.call(1);
|
| +g.call(1);
|
| +%OptimizeFunctionOnNextCall(g);
|
| +g.call(1);
|
| +assertOptimized(g);
|
|
|