Don't use StoreIC_ArrayLength on frozen arrays
authordanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Sun, 14 Jul 2013 22:03:46 +0000 (22:03 +0000)
committerdanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Sun, 14 Jul 2013 22:03:46 +0000 (22:03 +0000)
commitc65f4f7f7bbd64763c95144233f29b62661e798b
tree451c34f84fd3a0a78391309ad1c967e2fdeb0207
parent625a0e97594ee4e8ceb05f1c949d2625cad147c2
Don't use StoreIC_ArrayLength on frozen arrays

The code previously assumed that an array with fast properties must have
a writable length property. But Object.freeze() now exposes a way to make
length read-only without moving the object into slow mode. This patch
simply adds a !is_frozen check to the IC code. Any future optimizations
to attribute-setting on JSArrays will need to make similar accomodations.

R=danno
BUG=v8:2711,259548

Review URL: https://chromiumcodereview.appspot.com/19115002
Patch from Adam Klein <adamk@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15651 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/ic.cc
test/mjsunit/regress/regress-2711.js [new file with mode: 0644]