Changeset 147887 in webkit
- Timestamp:
- Apr 7, 2013 5:43:46 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r147879 r147887 1 2013-04-07 Benjamin Poulain <benjamin@webkit.org> 2 3 Use Vector::reserveInitialCapacity() when possible in JavaScriptCore runtime 4 https://bugs.webkit.org/show_bug.cgi?id=114111 5 6 Reviewed by Andreas Kling. 7 8 Almost all the code was already using Vector::reserveInitialCapacity() 9 and Vector::uncheckedAppend(). Fix the remaining parts. 10 11 * runtime/ArgList.h: 12 (MarkedArgumentBuffer): The type VectorType is unused. 13 14 * runtime/ArrayPrototype.cpp: 15 (JSC::arrayProtoFuncSort): 16 Move the variable closer to where it is needed. 17 18 * runtime/JSArray.cpp: 19 (JSC::JSArray::setLengthWithArrayStorage): 20 * runtime/JSObject.cpp: 21 (JSC::JSObject::getOwnPropertyNames): 22 1 23 2013-04-07 Patrick Gansterer <paroga@webkit.org> 2 24 -
trunk/Source/JavaScriptCore/runtime/ArgList.h
r133800 r147887 39 39 private: 40 40 static const size_t inlineCapacity = 8; 41 typedef Vector<Register, inlineCapacity> VectorType;42 41 typedef HashSet<MarkedArgumentBuffer*> ListSet; 43 42 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r145628 r147887 739 739 return performSlowSort(exec, thisObj, length, function, callData, callType) ? JSValue::encode(thisObj) : JSValue::encode(jsUndefined()); 740 740 741 Vector<uint32_t> keys;742 743 741 JSGlobalObject* globalObject = JSGlobalObject::create( 744 742 exec->globalData(), JSGlobalObject::createStructure(exec->globalData(), jsNull())); … … 751 749 if (exec->hadException()) 752 750 return JSValue::encode(jsUndefined()); 753 751 752 Vector<uint32_t> keys; 754 753 for (size_t i = 0; i < nameArray.size(); ++i) { 755 754 PropertyName name = nameArray[i]; -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r141154 r147887 351 351 // Copy any keys we might be interested in into a vector. 352 352 Vector<unsigned> keys; 353 keys.reserve Capacity(min(map->size(), static_cast<size_t>(length - newLength)));353 keys.reserveInitialCapacity(min(map->size(), static_cast<size_t>(length - newLength))); 354 354 SparseArrayValueMap::const_iterator end = map->end(); 355 355 for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it) { -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r147570 r147887 1508 1508 if (SparseArrayValueMap* map = storage->m_sparseMap.get()) { 1509 1509 Vector<unsigned> keys; 1510 keys.reserve Capacity(map->size());1510 keys.reserveInitialCapacity(map->size()); 1511 1511 1512 1512 SparseArrayValueMap::const_iterator end = map->end(); 1513 1513 for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it) { 1514 1514 if (mode == IncludeDontEnumProperties || !(it->value.attributes & DontEnum)) 1515 keys. append(static_cast<unsigned>(it->key));1515 keys.uncheckedAppend(static_cast<unsigned>(it->key)); 1516 1516 } 1517 1517
Note: See TracChangeset
for help on using the changeset viewer.