Title: [192453] trunk/Source/_javascript_Core
Revision
192453
Author
commit-qu...@webkit.org
Date
2015-11-13 17:18:58 -0800 (Fri, 13 Nov 2015)

Log Message

Unreviewed, rolling out r192416 and r192443.
https://bugs.webkit.org/show_bug.cgi?id=151285

Broke 32-bit in some mysterious way I need to understand
(Requested by kling on #webkit).

Reverted changesets:

"[JSC] JSPropertyNameEnumerator could be destructorless."
https://bugs.webkit.org/show_bug.cgi?id=151242
http://trac.webkit.org/changeset/192416

"Follow-up for 32-bit test failures after..."
https://bugs.webkit.org/show_bug.cgi?id=151242
http://trac.webkit.org/changeset/192443

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (192452 => 192453)


--- trunk/Source/_javascript_Core/ChangeLog	2015-11-14 00:56:22 UTC (rev 192452)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-11-14 01:18:58 UTC (rev 192453)
@@ -1,5 +1,23 @@
 2015-11-13  Commit Queue  <commit-qu...@webkit.org>
 
+        Unreviewed, rolling out r192416 and r192443.
+        https://bugs.webkit.org/show_bug.cgi?id=151285
+
+        Broke 32-bit in some mysterious way I need to understand
+        (Requested by kling on #webkit).
+
+        Reverted changesets:
+
+        "[JSC] JSPropertyNameEnumerator could be destructorless."
+        https://bugs.webkit.org/show_bug.cgi?id=151242
+        http://trac.webkit.org/changeset/192416
+
+        "Follow-up for 32-bit test failures after..."
+        https://bugs.webkit.org/show_bug.cgi?id=151242
+        http://trac.webkit.org/changeset/192443
+
+2015-11-13  Commit Queue  <commit-qu...@webkit.org>
+
         Unreviewed, rolling out r192401.
         https://bugs.webkit.org/show_bug.cgi?id=151282
 

Modified: trunk/Source/_javascript_Core/heap/CopyToken.h (192452 => 192453)


--- trunk/Source/_javascript_Core/heap/CopyToken.h	2015-11-14 00:56:22 UTC (rev 192452)
+++ trunk/Source/_javascript_Core/heap/CopyToken.h	2015-11-14 01:18:58 UTC (rev 192453)
@@ -32,8 +32,7 @@
     ButterflyCopyToken,
     TypedArrayVectorCopyToken,
     MapBackingStoreCopyToken,
-    DirectArgumentsOverridesCopyToken,
-    JSPropertyNameEnumeratorCopyToken,
+    DirectArgumentsOverridesCopyToken
 };
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/JSPropertyNameEnumerator.cpp (192452 => 192453)


--- trunk/Source/_javascript_Core/runtime/JSPropertyNameEnumerator.cpp	2015-11-14 00:56:22 UTC (rev 192452)
+++ trunk/Source/_javascript_Core/runtime/JSPropertyNameEnumerator.cpp	2015-11-14 01:18:58 UTC (rev 192453)
@@ -26,8 +26,6 @@
 #include "config.h"
 #include "JSPropertyNameEnumerator.h"
 
-#include "CopiedBlockInlines.h"
-#include "CopyVisitorInlines.h"
 #include "JSCInlines.h"
 #include "StrongInlines.h"
 
@@ -72,45 +70,25 @@
     m_endStructurePropertyIndex = endStructurePropertyIndex;
     m_endGenericPropertyIndex = vector.size();
 
-    if (!vector.isEmpty()) {
-        void* backingStore;
-        RELEASE_ASSERT(vm.heap.tryAllocateStorage(this, propertyNameCacheSize(), &backingStore));
-        WriteBarrier<JSString>* propertyNames = reinterpret_cast<WriteBarrier<JSString>*>(backingStore);
-        m_propertyNames.set(vm, this, propertyNames);
-
-        for (unsigned i = 0; i < vector.size(); ++i)
-            propertyNames[i].set(vm, this, jsString(&vm, vector[i].string()));
+    m_propertyNames.resizeToFit(vector.size());
+    for (unsigned i = 0; i < vector.size(); ++i) {
+        const Identifier& identifier = vector[i];
+        m_propertyNames[i].set(vm, this, jsString(&vm, identifier.string()));
     }
 }
 
+void JSPropertyNameEnumerator::destroy(JSCell* cell)
+{
+    jsCast<JSPropertyNameEnumerator*>(cell)->JSPropertyNameEnumerator::~JSPropertyNameEnumerator();
+}
+
 void JSPropertyNameEnumerator::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
     Base::visitChildren(cell, visitor);
     JSPropertyNameEnumerator* thisObject = jsCast<JSPropertyNameEnumerator*>(cell);
+    for (unsigned i = 0; i < thisObject->m_propertyNames.size(); ++i)
+        visitor.append(&thisObject->m_propertyNames[i]);
     visitor.append(&thisObject->m_prototypeChain);
-
-    if (thisObject->cachedPropertyNameCount()) {
-        visitor.appendValues(reinterpret_cast<WriteBarrier<Unknown>*>(thisObject->m_propertyNames.getWithoutBarrier()), thisObject->cachedPropertyNameCount());
-        visitor.copyLater(
-            thisObject, JSPropertyNameEnumeratorCopyToken,
-            thisObject->m_propertyNames.getWithoutBarrier(), thisObject->propertyNameCacheSize());
-    }
 }
 
-void JSPropertyNameEnumerator::copyBackingStore(JSCell* cell, CopyVisitor& visitor, CopyToken token)
-{
-    JSPropertyNameEnumerator* thisObject = jsCast<JSPropertyNameEnumerator*>(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-
-    RELEASE_ASSERT(token == JSPropertyNameEnumeratorCopyToken);
-
-    void* oldPropertyNames = thisObject->m_propertyNames.getWithoutBarrier();
-    if (visitor.checkIfShouldCopy(oldPropertyNames)) {
-        WriteBarrier<JSString>* newPropertyNames = static_cast<WriteBarrier<JSString>*>(visitor.allocateNewSpace(thisObject->propertyNameCacheSize()));
-        memcpy(newPropertyNames, oldPropertyNames, thisObject->propertyNameCacheSize());
-        thisObject->m_propertyNames.setWithoutBarrier(newPropertyNames);
-        visitor.didCopy(oldPropertyNames, thisObject->propertyNameCacheSize());
-    }
-}
-
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/JSPropertyNameEnumerator.h (192452 => 192453)


--- trunk/Source/_javascript_Core/runtime/JSPropertyNameEnumerator.h	2015-11-14 00:56:22 UTC (rev 192452)
+++ trunk/Source/_javascript_Core/runtime/JSPropertyNameEnumerator.h	2015-11-14 01:18:58 UTC (rev 192453)
@@ -43,6 +43,9 @@
     static JSPropertyNameEnumerator* create(VM&);
     static JSPropertyNameEnumerator* create(VM&, Structure*, uint32_t, uint32_t, PropertyNameArray&);
 
+    static const bool needsDestruction = true;
+    static void destroy(JSCell*);
+
     static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
     {
         return Structure::create(vm, globalObject, prototype, TypeInfo(CellType, StructureFlags), info());
@@ -52,9 +55,9 @@
 
     JSString* propertyNameAtIndex(uint32_t index) const
     {
-        if (index >= cachedPropertyNameCount())
+        if (index >= m_propertyNames.size())
             return nullptr;
-        return m_propertyNames.get(this)[index].get();
+        return m_propertyNames[index].get();
     }
 
     StructureChain* cachedPrototypeChain() const { return m_prototypeChain.get(); }
@@ -78,30 +81,18 @@
     static ptrdiff_t cachedInlineCapacityOffset() { return OBJECT_OFFSETOF(JSPropertyNameEnumerator, m_cachedInlineCapacity); }
     static ptrdiff_t cachedPropertyNamesVectorOffset()
     {
-        return OBJECT_OFFSETOF(JSPropertyNameEnumerator, m_propertyNames);
+        return OBJECT_OFFSETOF(JSPropertyNameEnumerator, m_propertyNames) + Vector<WriteBarrier<JSString>>::dataMemoryOffset();
     }
 
     static void visitChildren(JSCell*, SlotVisitor&);
-    static void copyBackingStore(JSCell*, CopyVisitor&, CopyToken);
 
-    uint32_t cachedPropertyNameCount() const
-    {
-        // Note that this depends on m_endGenericPropertyIndex being the number of entries in m_propertyNames.
-        return m_endGenericPropertyIndex;
-    }
-
-    size_t propertyNameCacheSize() const
-    {
-        return WTF::roundUpToMultipleOf<8>(cachedPropertyNameCount() * sizeof(WriteBarrier<JSString>));
-    }
-
 private:
     JSPropertyNameEnumerator(VM&, StructureID, uint32_t);
     void finishCreation(VM&, uint32_t, uint32_t, PassRefPtr<PropertyNameArrayData>);
 
-    CopyBarrier<WriteBarrier<JSString>> m_propertyNames;
-    WriteBarrier<StructureChain> m_prototypeChain;
+    Vector<WriteBarrier<JSString>> m_propertyNames;
     StructureID m_cachedStructureID;
+    WriteBarrier<StructureChain> m_prototypeChain;
     uint32_t m_indexedLength;
     uint32_t m_endStructurePropertyIndex;
     uint32_t m_endGenericPropertyIndex;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to