Changeset 222382 in webkit for trunk/Source/JavaScriptCore/runtime/JSArray.h
- Timestamp:
- Sep 22, 2017, 3:25:58 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSArray.h
r222380 r222382 55 55 public: 56 56 static JSArray* tryCreate(VM&, Structure*, unsigned initialLength = 0); 57 static JSArray* tryCreate(VM&, Structure*, unsigned initialLength, unsigned vectorLengthHint);58 57 static JSArray* create(VM&, Structure*, unsigned initialLength = 0); 59 58 static JSArray* createWithButterfly(VM&, GCDeferralContext*, Structure*, Butterfly*); … … 217 216 VM&, JSCell* intendedOwner, unsigned initialLength); 218 217 219 inline JSArray* JSArray::tryCreate(VM& vm, Structure* structure, unsigned initialLength, unsigned vectorLengthHint) 220 { 221 ASSERT(vectorLengthHint >= initialLength); 218 inline JSArray* JSArray::tryCreate(VM& vm, Structure* structure, unsigned initialLength) 219 { 222 220 unsigned outOfLineStorage = structure->outOfLineCapacity(); 223 221 … … 231 229 || hasContiguous(indexingType)); 232 230 233 if (UNLIKELY( vectorLengthHint> MAX_STORAGE_VECTOR_LENGTH))231 if (UNLIKELY(initialLength > MAX_STORAGE_VECTOR_LENGTH)) 234 232 return nullptr; 235 233 236 unsigned vectorLength = Butterfly::optimalContiguousVectorLength(structure, vectorLengthHint);234 unsigned vectorLength = Butterfly::optimalContiguousVectorLength(structure, initialLength); 237 235 void* temp = vm.jsValueGigacageAuxiliarySpace.tryAllocate(nullptr, Butterfly::totalSize(0, outOfLineStorage, true, vectorLength * sizeof(EncodedJSValue))); 238 236 if (!temp) … … 259 257 } 260 258 261 inline JSArray* JSArray::tryCreate(VM& vm, Structure* structure, unsigned initialLength)262 {263 return tryCreate(vm, structure, initialLength, initialLength);264 }265 266 259 inline JSArray* JSArray::create(VM& vm, Structure* structure, unsigned initialLength) 267 260 {
Note:
See TracChangeset
for help on using the changeset viewer.