| Index: test/webkit/dfg-int32-to-double-on-set-local-and-exit.js
|
| diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/dfg-int32-to-double-on-set-local-and-exit.js
|
| similarity index 64%
|
| copy from test/webkit/concat-while-having-a-bad-time.js
|
| copy to test/webkit/dfg-int32-to-double-on-set-local-and-exit.js
|
| index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..8686391163732102020e7b8a38b5712111e9b704 100644
|
| --- a/test/webkit/concat-while-having-a-bad-time.js
|
| +++ b/test/webkit/dfg-int32-to-double-on-set-local-and-exit.js
|
| @@ -22,10 +22,42 @@
|
| // 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 that an Int32ToDouble placed on a SetLocal does a forward exit."
|
| );
|
|
|
| -Object.defineProperty(Array.prototype, 0, { writable: false });
|
| -shouldBe("[42].concat()", "[42]");
|
| +var counter = 0;
|
|
|
| +function checkpoint(text) {
|
| + debug("Checkpoint: " + text);
|
| + counter++;
|
| +}
|
|
|
| +function func1() {
|
| + checkpoint("a");
|
| + a = Date.now() + Date.now() + Date.now() + Date.now() + Date.now() + Date.now();
|
| + checkpoint("b");
|
| +}
|
| +function func2() {
|
| + checkpoint("c");
|
| + return Date.now() + Date.now() + Date.now() + Date.now() + Date.now() + Date.now();
|
| +}
|
| +
|
| +function func3(s) {
|
| + checkpoint("1");
|
| + s = func1(); // The bug is that this function will be called twice, if our Int32ToDouble hoisting does a backward speculation.
|
| + checkpoint("2");
|
| + s = func2();
|
| + checkpoint("3");
|
| + return s;
|
| +}
|
| +
|
| +function test() {
|
| + return func3(1);
|
| +}
|
| +
|
| +
|
| +for (var i=0; i < 200; i++) {
|
| + test();
|
| +}
|
| +
|
| +shouldBe("counter", "1200");
|
|
|