Changeset 153374 in webkit for trunk/Source/JavaScriptCore/runtime/JSObject.cpp
- Timestamp:
- Jul 26, 2013, 11:07:34 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r153223 r153374 1854 1854 if (i >= MAX_ARRAY_INDEX - 1 1855 1855 || (i >= MIN_SPARSE_ARRAY_INDEX 1856 && !isDenseEnoughForVector(i, countElements<indexingShape>(m_butterfly)))) { 1856 && !isDenseEnoughForVector(i, countElements<indexingShape>(m_butterfly))) 1857 || indexIsSufficientlyBeyondLengthForSparseMap(i, m_butterfly->vectorLength())) { 1857 1858 ASSERT(i <= MAX_ARRAY_INDEX); 1858 1859 ensureArrayStorageSlow(vm); … … 1902 1903 // First, handle cases where we don't currently have a sparse map. 1903 1904 if (LIKELY(!map)) { 1904 // If the array is not extensible, we should have entered dictionary mode, and created the spar e map.1905 // If the array is not extensible, we should have entered dictionary mode, and created the sparse map. 1905 1906 ASSERT(isExtensible()); 1906 1907 … … 1910 1911 1911 1912 // Check that it is sensible to still be using a vector, and then try to grow the vector. 1912 if (LIKELY((isDenseEnoughForVector(i, storage->m_numValuesInVector)) && increaseVectorLength(vm, i + 1))) { 1913 if (LIKELY(!indexIsSufficientlyBeyondLengthForSparseMap(i, storage->vectorLength()) 1914 && isDenseEnoughForVector(i, storage->m_numValuesInVector) 1915 && increaseVectorLength(vm, i + 1))) { 1913 1916 // success! - reread m_storage since it has likely been reallocated, and store to the vector. 1914 1917 storage = arrayStorage(); … … 1977 1980 break; 1978 1981 } 1979 if (i >= MIN_SPARSE_ARRAY_INDEX) {1982 if (indexIsSufficientlyBeyondLengthForSparseMap(i, 0) || i >= MIN_SPARSE_ARRAY_INDEX) { 1980 1983 putByIndexBeyondVectorLengthWithArrayStorage( 1981 1984 exec, i, value, shouldThrow, createArrayStorage(vm, 0, 0)); … … 2057 2060 !attributes 2058 2061 && (isDenseEnoughForVector(i, storage->m_numValuesInVector)) 2059 && increaseVectorLength(vm, i + 1))) { 2062 && increaseVectorLength(vm, i + 1) 2063 && !indexIsSufficientlyBeyondLengthForSparseMap(i, storage->vectorLength()))) { 2060 2064 // success! - reread m_storage since it has likely been reallocated, and store to the vector. 2061 2065 storage = arrayStorage();
Note:
See TracChangeset
for help on using the changeset viewer.