From 815f1ed417bd26fbe2abbdf20ac5d3423b30796c Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 23 Jul 2012 09:28:44 +0200 Subject: Imported WebKit commit e65cbc5b6ac32627c797e7fc7f46eb7794410c92 (http://svn.webkit.org/repository/webkit/trunk@123308) New snapshot with better configure tests --- Source/JavaScriptCore/runtime/JSObject.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'Source/JavaScriptCore/runtime/JSObject.cpp') diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp index ccc49fd5c..587929f66 100644 --- a/Source/JavaScriptCore/runtime/JSObject.cpp +++ b/Source/JavaScriptCore/runtime/JSObject.cpp @@ -599,19 +599,13 @@ PropertyStorage JSObject::growOutOfLineStorage(JSGlobalData& globalData, size_t PropertyStorage oldPropertyStorage = m_outOfLineStorage.get(); PropertyStorage newPropertyStorage = 0; - if (!oldPropertyStorage) { - // We have this extra temp here to slake GCC's thirst for the blood of those who dereference type-punned pointers. - void* temp = newPropertyStorage; - if (!globalData.heap.tryAllocateStorage(sizeof(WriteBarrierBase) * newSize, &temp)) - CRASH(); - newPropertyStorage = static_cast(temp); - } else { - // We have this extra temp here to slake GCC's thirst for the blood of those who dereference type-punned pointers. - void* temp = oldPropertyStorage; - if (!globalData.heap.tryReallocateStorage(&temp, sizeof(WriteBarrierBase) * oldSize, sizeof(WriteBarrierBase) * newSize)) - CRASH(); - newPropertyStorage = static_cast(temp); - } + // We have this extra temp here to slake GCC's thirst for the blood of those who dereference type-punned pointers. + void* temp = newPropertyStorage; + if (!globalData.heap.tryAllocateStorage(sizeof(WriteBarrierBase) * newSize, &temp)) + CRASH(); + newPropertyStorage = static_cast(temp); + + memcpy(newPropertyStorage, oldPropertyStorage, sizeof(WriteBarrierBase) * oldSize); ASSERT(newPropertyStorage); return newPropertyStorage; -- cgit v1.2.1