| Index: test/webkit/dfg-store-unexpected-value-into-argument-and-osr-exit.js
|
| diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/dfg-store-unexpected-value-into-argument-and-osr-exit.js
|
| similarity index 62%
|
| copy from test/webkit/concat-while-having-a-bad-time.js
|
| copy to test/webkit/dfg-store-unexpected-value-into-argument-and-osr-exit.js
|
| index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..1006c2840aeb6c45d44c243eadf0819cd15ae5aa 100644
|
| --- a/test/webkit/concat-while-having-a-bad-time.js
|
| +++ b/test/webkit/dfg-store-unexpected-value-into-argument-and-osr-exit.js
|
| @@ -22,10 +22,43 @@
|
| // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| description(
|
| -"Tests the behavior of Array.prototype.concat while the array is having a bad time due to one of the elements we are concatenating."
|
| +"Tests what happens when you store an unexpected value into an argument (where the original argument value was the expected one) and then OSR exit."
|
| );
|
|
|
| -Object.defineProperty(Array.prototype, 0, { writable: false });
|
| -shouldBe("[42].concat()", "[42]");
|
| +function foo(x, o, p) {
|
| + x = o.f;
|
| + if (p) {
|
| + var result = o.g + x;
|
| + x = true; // Force x to not have a hoisted integer speculation.
|
| + return result;
|
| + } else
|
| + return o.g - x;
|
| +}
|
|
|
| +for (var i = 0; i < 200; ++i) {
|
| + var expected;
|
| + var p, f, g;
|
| + if (i < 150) {
|
| + f = 42;
|
| + g = 43;
|
| + if (i%2) {
|
| + p = true;
|
| + expected = 85;
|
| + } else {
|
| + p = false;
|
| + expected = 1;
|
| + }
|
| + } else {
|
| + f = 42.5;
|
| + g = 43;
|
| + if (i%2) {
|
| + p = true;
|
| + expected = 85.5;
|
| + } else {
|
| + p = false;
|
| + expected = 0.5;
|
| + }
|
| + }
|
| + shouldBe("foo(3, {f:f, g:g}, p)", "" + expected);
|
| +}
|
|
|
|
|