Changeset 123417 in webkit for trunk/Source/JavaScriptCore/runtime/JSObject.cpp
- Timestamp:
- Jul 23, 2012, 7:13:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r123164 r123417 100 100 if (storage) { 101 101 size_t storageSize = thisObject->structure()->outOfLineSizeForKnownNonFinalObject(); 102 size_t capacity = thisObject->structure()->outOfLineCapacity(); 102 103 // We have this extra temp here to slake GCC's thirst for the blood of those who dereference type-punned pointers. 103 void* temp = storage ;104 visitor.copyAndAppend(&temp, thisObject->structure()->outOfLineCapacity() * sizeof(WriteBarrierBase<Unknown>), storage->slot(), storageSize);105 storage = static_cast<PropertyStorage>(temp) ;104 void* temp = storage - capacity - 1; 105 visitor.copyAndAppend(&temp, capacity * sizeof(WriteBarrierBase<Unknown>), (storage - storageSize - 1)->slot(), storageSize); 106 storage = static_cast<PropertyStorage>(temp) + capacity + 1; 106 107 thisObject->m_outOfLineStorage.set(storage, StorageBarrier::Unchecked); 107 108 } … … 129 130 if (storage) { 130 131 size_t storageSize = thisObject->structure()->outOfLineSizeForKnownFinalObject(); 132 size_t capacity = thisObject->structure()->outOfLineCapacity(); 131 133 // We have this extra temp here to slake GCC's thirst for the blood of those who dereference type-punned pointers. 132 void* temp = storage ;133 visitor.copyAndAppend(&temp, thisObject->structure()->outOfLineCapacity() * sizeof(WriteBarrierBase<Unknown>), storage->slot(), storageSize);134 storage = static_cast<PropertyStorage>(temp) ;134 void* temp = storage - capacity - 1; 135 visitor.copyAndAppend(&temp, thisObject->structure()->outOfLineCapacity() * sizeof(WriteBarrierBase<Unknown>), (storage - storageSize - 1)->slot(), storageSize); 136 storage = static_cast<PropertyStorage>(temp) + capacity + 1; 135 137 thisObject->m_outOfLineStorage.set(storage, StorageBarrier::Unchecked); 136 138 } … … 596 598 // It's important that this function not rely on structure(), since 597 599 // we might be in the middle of a transition. 598 600 599 601 PropertyStorage oldPropertyStorage = m_outOfLineStorage.get(); 600 602 PropertyStorage newPropertyStorage = 0; … … 604 606 if (!globalData.heap.tryAllocateStorage(sizeof(WriteBarrierBase<Unknown>) * newSize, &temp)) 605 607 CRASH(); 606 newPropertyStorage = static_cast<PropertyStorage>(temp) ;608 newPropertyStorage = static_cast<PropertyStorage>(temp) + newSize + 1; 607 609 608 memcpy(newPropertyStorage , oldPropertyStorage, sizeof(WriteBarrierBase<Unknown>) * oldSize);610 memcpy(newPropertyStorage - oldSize - 1, oldPropertyStorage - oldSize - 1, sizeof(WriteBarrierBase<Unknown>) * oldSize); 609 611 610 612 ASSERT(newPropertyStorage);
Note:
See TracChangeset
for help on using the changeset viewer.