Ignore:
Timestamp:
Nov 30, 2017, 4:14:34 PM (7 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r225362.
https://bugs.webkit.org/show_bug.cgi?id=180225

removeIf predicate function can touch remove target set
(Requested by yusukesuzuki on #webkit).

Reverted changeset:

"[JSC] Remove easy toRemove & map.remove() use"
https://bugs.webkit.org/show_bug.cgi?id=180208
https://trac.webkit.org/changeset/225362

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp

    r225362 r225368  
    508508    void pruneByLiveness(const NodeSet& live)
    509509    {
    510         m_pointers.removeIf(
    511             [&] (const auto& entry) {
    512                 return !live.contains(entry.key);
    513             });
     510        Vector<Node*> toRemove;
     511        for (const auto& entry : m_pointers) {
     512            if (!live.contains(entry.key))
     513                toRemove.append(entry.key);
     514        }
     515        for (Node* node : toRemove)
     516            m_pointers.remove(node);
     517
    514518        prune();
    515519    }
     
    679683
    680684        // Remove unreachable allocations
    681         m_allocations.removeIf(
    682             [&] (const auto& entry) {
    683                 return !reachable.contains(entry.key);
    684             });
     685        {
     686            Vector<Node*> toRemove;
     687            for (const auto& entry : m_allocations) {
     688                if (!reachable.contains(entry.key))
     689                    toRemove.append(entry.key);
     690            }
     691            for (Node* identifier : toRemove)
     692                m_allocations.remove(identifier);
     693        }
    685694    }
    686695
     
    12411250        // We don't create materializations if the escapee is not a
    12421251        // sink candidate
    1243         escapees.removeIf(
    1244             [&] (const auto& entry) {
    1245                 return !m_sinkCandidates.contains(entry.key);
    1246             });
     1252        Vector<Node*> toRemove;
     1253        for (const auto& entry : escapees) {
     1254            if (!m_sinkCandidates.contains(entry.key))
     1255                toRemove.append(entry.key);
     1256        }
     1257        for (Node* identifier : toRemove)
     1258            escapees.remove(identifier);
     1259
    12471260        if (escapees.isEmpty())
    12481261            return;
Note: See TracChangeset for help on using the changeset viewer.