Ignore:
Timestamp:
Feb 26, 2016, 2:58:54 PM (9 years ago)
Author:
[email protected]
Message:

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

Patch by Joseph Pecoraro <Joseph Pecoraro> 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Structure.cpp

    r190113 r197210  
    11541154    JSValue curValue = value;
    11551155    while (curStructure) {
    1156         Vector<Structure*, 8> structures;
    1157         Structure* structure;
    1158         PropertyTable* table;
    1159 
    1160         curStructure->findStructuresAndMapForMaterialization(structures, structure, table);
    1161         if (table) {
    1162             PropertyTable::iterator iter = table->begin();
    1163             PropertyTable::iterator end = table->end();
    1164             for (; iter != end; ++iter)
    1165                 curShape->addProperty(*iter->key);
    1166            
    1167             structure->m_lock.unlock();
    1168         }
    1169         for (unsigned i = structures.size(); i--;) {
    1170             Structure* structure = structures[i];
    1171             if (structure->m_nameInPrevious)
    1172                 curShape->addProperty(*structure->m_nameInPrevious);
    1173         }
     1156        curStructure->forEachPropertyConcurrently(
     1157            [&] (const PropertyMapEntry& entry) -> bool {
     1158                curShape->addProperty(*entry.key);
     1159                return true;
     1160            });
    11741161
    11751162        if (JSObject* curObject = curValue.getObject())
Note: See TracChangeset for help on using the changeset viewer.