| Index: test/webkit/dfg-cfg-simplify-redundant-dead-get-local.js
|
| diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/dfg-cfg-simplify-redundant-dead-get-local.js
|
| similarity index 66%
|
| copy from test/webkit/concat-while-having-a-bad-time.js
|
| copy to test/webkit/dfg-cfg-simplify-redundant-dead-get-local.js
|
| index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..085af05577af4c3c30fcec5a4eec7a8cf5b547e0 100644
|
| --- a/test/webkit/concat-while-having-a-bad-time.js
|
| +++ b/test/webkit/dfg-cfg-simplify-redundant-dead-get-local.js
|
| @@ -22,10 +22,33 @@
|
| // 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 if the CFG simplifier gracefully handles the case where Block #1 and #2 are merged, #1 has a dead GetLocal, and #2 has a live GetLocal on the same local."
|
| );
|
|
|
| -Object.defineProperty(Array.prototype, 0, { writable: false });
|
| -shouldBe("[42].concat()", "[42]");
|
| +var array = [];
|
|
|
| +var getDist = function () {
|
| + // a conditional absolutely MUST be here for the whole thing to break.
|
| + // the return value is irrelevant
|
|
|
| + if (false) return "I'm irrelevant!";
|
| +
|
| + return Math.sqrt(5);
|
| +}
|
| +
|
| +
|
| +var calcError = function(){
|
| + var dist = 0; // initialisation is necessary for the bug to occur
|
| +
|
| + true && (dist = getDist());
|
| +
|
| + array.push(dist);
|
| +}
|
| +
|
| +
|
| +for(var a=0; a<1000; a++){ // the loop needs to be outside calcError, otherwise no bug...
|
| + calcError();
|
| +}
|
| +
|
| +for (var i = 0; i < array.length; ++i)
|
| + shouldBe("array[i]", "2.23606797749979");
|
|
|