Ignore:
Timestamp:
Dec 15, 2009, 2:40:00 PM (15 years ago)
Author:
[email protected]
Message:

Removed the number heap, replacing it with a one-item free list for
numbers, taking advantage of the fact that two number cells fit inside
the space for one regular cell, and number cells don't require destruction.

Reviewed by Oliver Hunt.

SunSpider says 1.6% faster in JSVALUE32 mode (the only mode that
heap-allocates numbers).

SunSpider says 1.1% faster in JSVALUE32_64 mode. v8 says 0.8% faster
in JSVALUE32_64 mode. 10% speedup on bench-alloc-nonretained.js. 6%
speedup on bench-alloc-retained.js.

There's a lot of formulaic change in this patch, but not much substance.

(JSC::Debugger::recompileAllJSFunctions):

  • runtime/Collector.cpp:

(JSC::Heap::Heap):
(JSC::Heap::destroy):
(JSC::Heap::allocateBlock):
(JSC::Heap::freeBlock):
(JSC::Heap::freeBlockPtr):
(JSC::Heap::freeBlocks):
(JSC::Heap::recordExtraCost):
(JSC::Heap::allocate):
(JSC::Heap::resizeBlocks):
(JSC::Heap::growBlocks):
(JSC::Heap::shrinkBlocks):
(JSC::Heap::markConservatively):
(JSC::Heap::clearMarkBits):
(JSC::Heap::markedCells):
(JSC::Heap::sweep):
(JSC::Heap::markRoots):
(JSC::Heap::objectCount):
(JSC::Heap::addToStatistics):
(JSC::Heap::statistics):
(JSC::Heap::isBusy):
(JSC::Heap::reset):
(JSC::Heap::collectAllGarbage):
(JSC::Heap::primaryHeapBegin):
(JSC::Heap::primaryHeapEnd):

  • runtime/Collector.h:

(JSC::): Removed all code pertaining to the number heap, and changed all
heap template functions and classes to non-template functions and classes.

(JSC::Heap::allocateNumber): A new optimization to replace the number
heap: allocate half-sized number cells in pairs, returning the first
cell and caching the second cell for the next allocation.

  • runtime/CollectorHeapIterator.h:

(JSC::LiveObjectIterator::LiveObjectIterator):
(JSC::LiveObjectIterator::operator++):
(JSC::DeadObjectIterator::DeadObjectIterator):
(JSC::DeadObjectIterator::operator++):
(JSC::ObjectIterator::ObjectIterator):
(JSC::ObjectIterator::operator++):

  • runtime/JSCell.h:

(JSC::JSCell::isNumber): Removed all code pertaining to the number heap,
and changed all heap template functions and classes to non-template functions
and classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/debugger/Debugger.cpp

    r52082 r52176  
    6868    SourceProviderMap sourceProviders;
    6969
    70     LiveObjectIterator<PrimaryHeap> it = globalData->heap.primaryHeapBegin();
    71     LiveObjectIterator<PrimaryHeap> heapEnd = globalData->heap.primaryHeapEnd();
     70    LiveObjectIterator it = globalData->heap.primaryHeapBegin();
     71    LiveObjectIterator heapEnd = globalData->heap.primaryHeapEnd();
    7272    for ( ; it != heapEnd; ++it) {
    7373        if (!(*it)->inherits(&JSFunction::info))
Note: See TracChangeset for help on using the changeset viewer.