Changeset 217869 in webkit
- Timestamp:
- Jun 6, 2017, 5:28:47 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r217866 r217869 1 2017-06-06 Mark Lam <mark.lam@apple.com> 2 3 Contiguous storage butterfly length should not exceed MAX_STORAGE_VECTOR_LENGTH. 4 https://bugs.webkit.org/show_bug.cgi?id=173035 5 <rdar://problem/32554593> 6 7 Reviewed by Geoffrey Garen and Filip Pizlo. 8 9 * stress/regress-173035.js: Added. 10 1 11 2017-06-06 Saam Barati <sbarati@apple.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r217866 r217869 1 2017-06-06 Mark Lam <mark.lam@apple.com> 2 3 Contiguous storage butterfly length should not exceed MAX_STORAGE_VECTOR_LENGTH. 4 https://bugs.webkit.org/show_bug.cgi?id=173035 5 <rdar://problem/32554593> 6 7 Reviewed by Geoffrey Garen and Filip Pizlo. 8 9 Also added and fixed up some assertions. 10 11 * runtime/ArrayConventions.h: 12 * runtime/JSArray.cpp: 13 (JSC::JSArray::setLength): 14 * runtime/JSObject.cpp: 15 (JSC::JSObject::createInitialIndexedStorage): 16 (JSC::JSObject::ensureLengthSlow): 17 (JSC::JSObject::reallocateAndShrinkButterfly): 18 * runtime/JSObject.h: 19 (JSC::JSObject::ensureLength): 20 * runtime/RegExpObject.cpp: 21 (JSC::collectMatches): 22 * runtime/RegExpPrototype.cpp: 23 (JSC::regExpProtoFuncSplitFast): 24 1 25 2017-06-06 Saam Barati <sbarati@apple.com> 2 26 -
trunk/Source/JavaScriptCore/runtime/ArrayConventions.h
r206525 r217869 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2003 , 2007, 2008, 2009, 2012, 2016Apple Inc. All rights reserved.3 * Copyright (C) 2003-2017 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 69 69 // 0xFFFFFFFF is a bit weird -- is not an array index even though it's an integer. 70 70 #define MAX_ARRAY_INDEX 0xFFFFFFFEU 71 72 static_assert(MIN_SPARSE_ARRAY_INDEX <= MAX_STORAGE_VECTOR_INDEX, "MIN_SPARSE_ARRAY_INDEX must be less than or equal to MAX_STORAGE_VECTOR_INDEX"); 73 static_assert(MAX_STORAGE_VECTOR_INDEX <= MAX_ARRAY_INDEX, "MAX_STORAGE_VECTOR_INDEX must be less than or equal to MAX_ARRAY_INDEX"); 71 74 72 75 // The value BASE_XXX_VECTOR_LEN is the maximum number of vector elements we'll allocate -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r217108 r217869 570 570 if (newLength == butterfly->publicLength()) 571 571 return true; 572 if (newLength > = MAX_ARRAY_INDEX // This caseensures that we can do fast push.572 if (newLength > MAX_STORAGE_VECTOR_LENGTH // This check ensures that we can do fast push. 573 573 || (newLength >= MIN_SPARSE_ARRAY_INDEX 574 574 && !isDenseEnoughForVector(newLength, countElements()))) { -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r217843 r217869 1002 1002 Butterfly* JSObject::createInitialIndexedStorage(VM& vm, unsigned length) 1003 1003 { 1004 ASSERT(length < MAX_ARRAY_INDEX);1004 ASSERT(length <= MAX_STORAGE_VECTOR_LENGTH); 1005 1005 IndexingType oldType = indexingType(); 1006 1006 ASSERT_UNUSED(oldType, !hasIndexedProperties(oldType)); … … 3130 3130 Butterfly* butterfly = m_butterfly.get(); 3131 3131 3132 ASSERT(length < MAX_ARRAY_INDEX);3132 ASSERT(length <= MAX_STORAGE_VECTOR_LENGTH); 3133 3133 ASSERT(hasContiguous(indexingType()) || hasInt32(indexingType()) || hasDouble(indexingType()) || hasUndecided(indexingType())); 3134 3134 ASSERT(length > butterfly->vectorLength()); … … 3182 3182 void JSObject::reallocateAndShrinkButterfly(VM& vm, unsigned length) 3183 3183 { 3184 ASSERT(length < MAX_ARRAY_INDEX); 3185 ASSERT(length < MAX_STORAGE_VECTOR_LENGTH); 3184 ASSERT(length <= MAX_STORAGE_VECTOR_LENGTH); 3186 3185 ASSERT(hasContiguous(indexingType()) || hasInt32(indexingType()) || hasDouble(indexingType()) || hasUndecided(indexingType())); 3187 3186 ASSERT(m_butterfly.get()->vectorLength() > length); -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r216279 r217869 968 968 bool WARN_UNUSED_RETURN ensureLength(VM& vm, unsigned length) 969 969 { 970 ASSERT(length < MAX_ARRAY_INDEX);970 ASSERT(length <= MAX_STORAGE_VECTOR_LENGTH); 971 971 ASSERT(hasContiguous(indexingType()) || hasInt32(indexingType()) || hasDouble(indexingType()) || hasUndecided(indexingType())); 972 972 -
trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp
r217108 r217869 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2003 , 2007-2008, 2012, 2016Apple Inc. All Rights Reserved.3 * Copyright (C) 2003-2017 Apple Inc. All Rights Reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 205 205 MatchResult savedResult = result; 206 206 do { 207 if (array->length() + matchCount > =MAX_STORAGE_VECTOR_LENGTH) {207 if (array->length() + matchCount > MAX_STORAGE_VECTOR_LENGTH) { 208 208 throwOutOfMemoryError(exec, scope); 209 209 return jsUndefined(); -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r217108 r217869 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2003 , 2007-2008, 2016Apple Inc. All Rights Reserved.3 * Copyright (C) 2003-2017 Apple Inc. All Rights Reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 680 680 vm, regexp, input, inputSize, position, matchPosition, regExpIsSticky, regExpIsUnicode, 681 681 [&] () -> SplitControl { 682 if (resultLength + dryRunCount > =MAX_STORAGE_VECTOR_LENGTH)682 if (resultLength + dryRunCount > MAX_STORAGE_VECTOR_LENGTH) 683 683 return AbortSplit; 684 684 return ContinueSplit; … … 691 691 }); 692 692 693 if (resultLength + dryRunCount > =MAX_STORAGE_VECTOR_LENGTH) {693 if (resultLength + dryRunCount > MAX_STORAGE_VECTOR_LENGTH) { 694 694 throwOutOfMemoryError(exec, scope); 695 695 return encodedJSValue();
Note:
See TracChangeset
for help on using the changeset viewer.