if (!header && isJSArray(thisObj)) {
JSArray* array = asArray(thisObj);
- if (array->length() == length && array->unshiftCount(exec, count))
+ if (array->length() == length && asArray(thisObj)->unshiftCount(exec, count))
return;
}
ArrayStorage* storage = m_storage;
unsigned oldLength = storage->m_length;
+ ASSERT(count <= oldLength);
// If the array contains holes or is otherwise in an abnormal state,
// use the generic algorithm in ArrayPrototype.
if (length != storage->m_numValuesInVector || inSparseMode())
return false;
+ ASSERT(count <= length);
+
if (m_indexBias >= count) {
m_indexBias -= count;
char* newBaseStorage = reinterpret_cast<char*>(storage) - count * sizeof(WriteBarrier<Unknown>);