Narrow cases where Sparse/Smart versions of Array methods are used
authoradamk@chromium.org <adamk@chromium.org>
Thu, 23 Oct 2014 18:21:50 +0000 (18:21 +0000)
committeradamk@chromium.org <adamk@chromium.org>
Thu, 23 Oct 2014 18:21:50 +0000 (18:21 +0000)
commit5f1ae66d5634e43563b2d25ea652dfb94c31a3b4
tree2204d63d081115f768ebfabc82e4bd23264eb720
parentf3c3697521fb20bfa91b45863197f552726a422d
Narrow cases where Sparse/Smart versions of Array methods are used

Added a new %HasComplexElements runtime function (meaning elements that are
non-writable, non-configurable, or have getters and setters) and use it
in UseSparseVariant to filter out cases where the sparse optimizations
can cause V8 to fall out of spec compliance.

Renamed SmartMove/SmartSlice to SparseMove/SparseSlice and guarded them
with the new and improved UseSparseVariant.

These two changes combine let us pass nearly every test in bug-2615.js,
as well as fixing reverse and join on sparse arrays.

Note that there are various test changes in this patch that correct existing
tests to match the correct-by-spec behavior.

This patch depends on https://codereview.chromium.org/666883009, which
better-aligns the behavior of SmartMove with SimpleMove.

BUG=v8:2615,v8:3612,v8:3621
LOG=y
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/656423004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24855 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
13 files changed:
src/array.js
src/objects.cc
src/objects.h
src/runtime/runtime-array.cc
src/runtime/runtime.h
test/mjsunit/array-natives-elements.js
test/mjsunit/array-shift2.js
test/mjsunit/bugs/bug-2615.js
test/mjsunit/regress/regress-2615.js [new file with mode: 0644]
test/mjsunit/regress/regress-3612.js [moved from test/mjsunit/bugs/bug-3612.js with 100% similarity]
test/mjsunit/regress/regress-3621.js [moved from test/mjsunit/bugs/bug-3621.js with 100% similarity]
test/mjsunit/regress/regress-crbug-412319.js
test/mozilla/mozilla.status