Title: [105682] trunk/Source/_javascript_Core
Revision
105682
Author
[email protected]
Date
2012-01-23 19:55:17 -0800 (Mon, 23 Jan 2012)

Log Message

Unreviewed, rolling out r105676.
http://trac.webkit.org/changeset/105676
https://bugs.webkit.org/show_bug.cgi?id=76665

Breaks build on max due to compile warnings.

* runtime/JSObject.cpp:
(JSC::JSObject::finalize):
(JSC::JSObject::visitChildren):
(JSC::JSObject::allocatePropertyStorage):
* runtime/JSObject.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (105681 => 105682)


--- trunk/Source/_javascript_Core/ChangeLog	2012-01-24 03:20:08 UTC (rev 105681)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-01-24 03:55:17 UTC (rev 105682)
@@ -1,3 +1,17 @@
+2012-01-23  Luke Macpherson   <[email protected]>
+
+        Unreviewed, rolling out r105676.
+        http://trac.webkit.org/changeset/105676
+        https://bugs.webkit.org/show_bug.cgi?id=76665
+
+        Breaks build on max due to compile warnings.
+
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::finalize):
+        (JSC::JSObject::visitChildren):
+        (JSC::JSObject::allocatePropertyStorage):
+        * runtime/JSObject.h:
+
 2012-01-23  Mark Hahnenberg  <[email protected]>
 
         Use copying collector for out-of-line JSObject property storage

Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (105681 => 105682)


--- trunk/Source/_javascript_Core/runtime/JSObject.cpp	2012-01-24 03:20:08 UTC (rev 105681)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp	2012-01-24 03:55:17 UTC (rev 105682)
@@ -24,7 +24,6 @@
 #include "config.h"
 #include "JSObject.h"
 
-#include "BumpSpaceInlineMethods.h"
 #include "DatePrototype.h"
 #include "ErrorConstructor.h"
 #include "GetterSetter.h"
@@ -84,6 +83,11 @@
     }
 }
 
+void JSObject::finalize(JSCell* cell)
+{
+    delete [] jsCast<JSObject*>(cell)->m_propertyStorage.get();
+}
+
 void JSObject::destroy(JSCell* cell)
 {
     jsCast<JSObject*>(cell)->JSObject::~JSObject();
@@ -102,13 +106,7 @@
 
     PropertyStorage storage = thisObject->propertyStorage();
     size_t storageSize = thisObject->structure()->propertyStorageSize();
-    if (thisObject->isUsingInlineStorage())
-        visitor.appendValues(storage, storageSize);
-    else {
-        visitor.copyAndAppend(reinterpret_cast<void**>(&storage), thisObject->structure()->propertyStorageCapacity() * sizeof(WriteBarrierBase<Unknown>), storage->slot(), storageSize);
-        thisObject->m_propertyStorage.set(storage, StorageBarrier::Unchecked);
-    }
-
+    visitor.appendValues(storage, storageSize);
     if (thisObject->m_inheritorID)
         visitor.append(&thisObject->m_inheritorID);
 
@@ -635,23 +633,20 @@
 
     // It's important that this function not rely on structure(), since
     // we might be in the middle of a transition.
+    PropertyStorage newPropertyStorage = 0;
+    newPropertyStorage = new WriteBarrierBase<Unknown>[newSize];
 
     PropertyStorage oldPropertyStorage = m_propertyStorage.get();
-    PropertyStorage newPropertyStorage = 0;
+    ASSERT(newPropertyStorage);
 
-    if (isUsingInlineStorage()) {
-        if (!globalData.heap.tryAllocateStorage(sizeof(WriteBarrierBase<Unknown>) * newSize, reinterpret_cast<void**>(&newPropertyStorage)))
-            CRASH();
+    for (unsigned i = 0; i < oldSize; ++i)
+       newPropertyStorage[i] = oldPropertyStorage[i];
 
-        for (unsigned i = 0; i < oldSize; ++i)
-            newPropertyStorage[i] = oldPropertyStorage[i];
-    } else {
-        if (!globalData.heap.tryReallocateStorage(reinterpret_cast<void**>(&oldPropertyStorage), sizeof(WriteBarrierBase<Unknown>) * oldSize, sizeof(WriteBarrierBase<Unknown>) * newSize))
-            CRASH();
-        newPropertyStorage = oldPropertyStorage;
-    }
+    if (isUsingInlineStorage())
+        Heap::heap(this)->addFinalizer(this, &finalize);
+    else
+        delete [] oldPropertyStorage;
 
-    ASSERT(newPropertyStorage);
     m_propertyStorage.set(globalData, this, newPropertyStorage);
 }
 

Modified: trunk/Source/_javascript_Core/runtime/JSObject.h (105681 => 105682)


--- trunk/Source/_javascript_Core/runtime/JSObject.h	2012-01-24 03:20:08 UTC (rev 105681)
+++ trunk/Source/_javascript_Core/runtime/JSObject.h	2012-01-24 03:55:17 UTC (rev 105682)
@@ -90,6 +90,8 @@
 
         JS_EXPORT_PRIVATE static UString className(const JSObject*);
 
+        static void finalize(JSCell*);
+
         JSValue prototype() const;
         void setPrototype(JSGlobalData&, JSValue prototype);
         bool setPrototypeWithCycleCheck(JSGlobalData&, JSValue prototype);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to