Changeset 60323 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
May 27, 2010, 2:45:10 PM (15 years ago)
Author:
[email protected]
Message:

2010-05-27 Nathan Lawrence <[email protected]>

Reviewed by Geoffrey Garen.

Search for the new allocation one word at a time. Improves
performance on SunSpider by approximately 1%.
http://bugs.webkit.org/show_bug.cgi?id=39758

  • runtime/Collector.cpp: (JSC::Heap::allocate):
  • runtime/Collector.h: (JSC::CollectorBitmap::advanceToNextPossibleFreeCell):
Location:
trunk/JavaScriptCore/runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Collector.cpp

    r59526 r60323  
    395395                return cell;
    396396            }
    397         } while (++m_heap.nextCell != HeapConstants::cellsPerBlock);
     397            block->marked.advanceToNextPossibleFreeCell(m_heap.nextCell);
     398        } while (m_heap.nextCell != HeapConstants::cellsPerBlock);
    398399        m_heap.nextCell = 0;
    399400    } while (++m_heap.nextBlock != m_heap.usedBlocks);
  • trunk/JavaScriptCore/runtime/Collector.h

    r59526 r60323  
    221221        void clear(size_t n) { bits[n >> 5] &= ~(1 << (n & 0x1F)); }
    222222        void clearAll() { memset(bits, 0, sizeof(bits)); }
     223        ALWAYS_INLINE void advanceToNextPossibleFreeCell(size_t& startCell)
     224        {
     225            if (!~bits[startCell >> 5])
     226                startCell = (startCell & (~0x1F)) + 32;
     227            else
     228                ++startCell;
     229        }
    223230        size_t count(size_t startCell = 0)
    224231        {
Note: See TracChangeset for help on using the changeset viewer.