Title: [197210] trunk/Source/_javascript_Core
Revision
197210
Author
[email protected]
Date
2016-02-26 14:58:54 -0800 (Fri, 26 Feb 2016)

Log Message

Reduce direct callers of Structure::findStructuresAndMapForMaterialization
https://bugs.webkit.org/show_bug.cgi?id=154751

Patch by Joseph Pecoraro <[email protected]> on 2016-02-26
Reviewed by Mark Lam.

* runtime/Structure.cpp:
(JSC::Structure::toStructureShape):
This property name iteration is identical to Structure::forEachPropertyConcurrently.
Share the code and reduce callers to the subtle findStructuresAndMapForMaterialization.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (197209 => 197210)


--- trunk/Source/_javascript_Core/ChangeLog	2016-02-26 22:56:16 UTC (rev 197209)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-02-26 22:58:54 UTC (rev 197210)
@@ -1,3 +1,15 @@
+2016-02-26  Joseph Pecoraro  <[email protected]>
+
+        Reduce direct callers of Structure::findStructuresAndMapForMaterialization
+        https://bugs.webkit.org/show_bug.cgi?id=154751
+
+        Reviewed by Mark Lam.
+
+        * runtime/Structure.cpp:
+        (JSC::Structure::toStructureShape):
+        This property name iteration is identical to Structure::forEachPropertyConcurrently.
+        Share the code and reduce callers to the subtle findStructuresAndMapForMaterialization.
+
 2016-02-26  Mark Lam  <[email protected]>
 
         Function.name and Function.length should be configurable.

Modified: trunk/Source/_javascript_Core/runtime/Structure.cpp (197209 => 197210)


--- trunk/Source/_javascript_Core/runtime/Structure.cpp	2016-02-26 22:56:16 UTC (rev 197209)
+++ trunk/Source/_javascript_Core/runtime/Structure.cpp	2016-02-26 22:58:54 UTC (rev 197210)
@@ -1153,25 +1153,12 @@
     Structure* curStructure = this;
     JSValue curValue = value;
     while (curStructure) {
-        Vector<Structure*, 8> structures;
-        Structure* structure;
-        PropertyTable* table;
+        curStructure->forEachPropertyConcurrently(
+            [&] (const PropertyMapEntry& entry) -> bool {
+                curShape->addProperty(*entry.key);
+                return true;
+            });
 
-        curStructure->findStructuresAndMapForMaterialization(structures, structure, table);
-        if (table) {
-            PropertyTable::iterator iter = table->begin();
-            PropertyTable::iterator end = table->end();
-            for (; iter != end; ++iter)
-                curShape->addProperty(*iter->key);
-            
-            structure->m_lock.unlock();
-        }
-        for (unsigned i = structures.size(); i--;) {
-            Structure* structure = structures[i];
-            if (structure->m_nameInPrevious)
-                curShape->addProperty(*structure->m_nameInPrevious);
-        }
-
         if (JSObject* curObject = curValue.getObject())
             curShape->setConstructorName(JSObject::calculatedClassName(curObject));
         else
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to