How about adding a unit test that triggers the slow behavior in the current implementation?
https://chromiumcodereview.appspot.com/10532193/diff/6001/src/array.js File src/array.js (right): https://chromiumcodereview.appspot.com/10532193/diff/6001/src/array.js#newcode781 src/array.js:781: var t_array = []; How about creating an InternalArray of the appropriate size here? That obviates the need for the push() stub call later (you can just assign to the element) https://chromiumcodereview.appspot.com/10532193/diff/6001/src/array.js#newcode802 src/array.js:802: third_index = GetThirdIndex(a, from, to); It still seems to be the case that you can carefully construct an array that triggers the worst case. Is that something we need to avoid? https://chromiumcodereview.appspot.com/10532193/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
