Ignore:
Timestamp:
Aug 8, 2008, 2:48:10 AM (17 years ago)
Author:
[email protected]
Message:

Improve performance of arithmetic operators

Reviewed by Cameron Zwarich

Added a fast (non-virtual) mechanism to determine if a non-immediate JSValue*
is a JSNumberCell. We then use this to allow improved specialisation in many
arithmetic operators. SunSpider reports a 2.5% progression overall, with greater
than 10% progressions on a number of arithmetic heavy tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/collector.cpp

    r35478 r35639  
    160160}
    161161
     162template <Heap::HeapType heapType>
    162163static NEVER_INLINE CollectorBlock* allocateBlock()
    163164{
     
    200201    memset(reinterpret_cast<void*>(address), 0, BLOCK_SIZE);
    201202#endif
    202 
     203    reinterpret_cast<CollectorBlock*>(address)->type = heapType;
    203204    return reinterpret_cast<CollectorBlock*>(address);
    204205}
     
    347348        }
    348349
    349         targetBlock = (Block*)allocateBlock();
     350        targetBlock = (Block*)allocateBlock<heapType>();
    350351        targetBlock->freeList = targetBlock->cells;
    351352        targetBlock->heap = this;
Note: See TracChangeset for help on using the changeset viewer.