Ignore:
Timestamp:
Jan 10, 2018, 11:41:12 AM (8 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r226667 and r226673.
https://bugs.webkit.org/show_bug.cgi?id=181488

This caused a flaky crash. (Requested by mlewis13 on #webkit).

Reverted changesets:

"CodeBlocks should be in IsoSubspaces"
https://bugs.webkit.org/show_bug.cgi?id=180884
https://trac.webkit.org/changeset/226667

"REGRESSION (r226667): CodeBlocks should be in IsoSubspaces"
https://bugs.webkit.org/show_bug.cgi?id=180884
https://trac.webkit.org/changeset/226673

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/IsoCellSetInlines.h

    r226667 r226725  
    7979}
    8080
    81 template<typename Func>
    82 RefPtr<SharedTask<void(SlotVisitor&)>> IsoCellSet::forEachMarkedCellInParallel(const Func& func)
    83 {
    84     class Task : public SharedTask<void(SlotVisitor&)> {
    85     public:
    86         Task(IsoCellSet& set, const Func& func)
    87             : m_set(set)
    88             , m_blockSource(set.parallelNotEmptyMarkedBlockSource())
    89             , m_func(func)
    90         {
    91         }
    92        
    93         void run(SlotVisitor& visitor) override
    94         {
    95             while (MarkedBlock::Handle* handle = m_blockSource->run()) {
    96                 size_t blockIndex = handle->index();
    97                 auto* bits = m_set.m_bits[blockIndex].get();
    98                 handle->forEachMarkedCell(
    99                     [&] (size_t atomNumber, HeapCell* cell, HeapCell::Kind kind) -> IterationStatus {
    100                         if (bits->get(atomNumber))
    101                             m_func(visitor, cell, kind);
    102                         return IterationStatus::Continue;
    103                     });
    104             }
    105         }
    106        
    107     private:
    108         IsoCellSet& m_set;
    109         RefPtr<SharedTask<MarkedBlock::Handle*()>> m_blockSource;
    110         Func m_func;
    111         Lock m_lock;
    112     };
    113    
    114     return adoptRef(new Task(*this, func));
    115 }
    116 
    117 template<typename Func>
    118 void IsoCellSet::forEachLiveCell(const Func& func)
    119 {
    120     MarkedAllocator& allocator = m_subspace.m_allocator;
    121     m_blocksWithBits.forEachSetBit(
    122         [&] (size_t blockIndex) {
    123             MarkedBlock::Handle* block = allocator.m_blocks[blockIndex];
    124 
    125             // FIXME: We could optimize this by checking our bits before querying isLive.
    126             // OOPS! (need bug URL)
    127             auto* bits = m_bits[blockIndex].get();
    128             block->forEachLiveCell(
    129                 [&] (size_t atomNumber, HeapCell* cell, HeapCell::Kind kind) -> IterationStatus {
    130                     if (bits->get(atomNumber))
    131                         func(cell, kind);
    132                     return IterationStatus::Continue;
    133                 });
    134         });
    135 }
    136 
    13781} // namespace JSC
    13882
Note: See TracChangeset for help on using the changeset viewer.