Changeset 27711 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Nov 12, 2007, 12:00:29 AM (18 years ago)
Author:
oliver
Message:

Add special fastZeroedMalloc function to replace a
number of fastCalloc calls where one argument was 1.

Reviewed by Darin.

This results in a 0.4% progression in SunSpider, more
than making up for the earlier regression caused by
additional overflow checks.

Location:
trunk/JavaScriptCore/kjs
Files:
2 edited

Legend:

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

    r27448 r27711  
    7676    m_length = initialLength;
    7777    m_vectorLength = initialCapacity;
    78     m_storage = static_cast<ArrayStorage*>(fastCalloc(storageSize(initialCapacity), 1));
     78    m_storage = static_cast<ArrayStorage*>(fastZeroedMalloc(storageSize(initialCapacity)));
    7979
    8080    Collector::reportExtraMemoryCost(initialCapacity * sizeof(JSValue*));
  • trunk/JavaScriptCore/kjs/property_map.cpp

    r27678 r27711  
    510510#endif
    511511
    512     m_u.table = static_cast<Table*>(fastCalloc(1, Table::allocationSize(newTableSize)));
     512    m_u.table = static_cast<Table*>(fastZeroedMalloc(Table::allocationSize(newTableSize)));
    513513    m_u.table->size = newTableSize;
    514514    m_u.table->sizeMask = newTableSize - 1;
     
    535535    Table* oldTable = m_u.table;
    536536   
    537     m_u.table = static_cast<Table*>(fastCalloc(1, Table::allocationSize(newTableSize)));
     537    m_u.table = static_cast<Table*>(fastZeroedMalloc(Table::allocationSize(newTableSize)));
    538538    m_u.table->size = newTableSize;
    539539    m_u.table->sizeMask = newTableSize - 1;
Note: See TracChangeset for help on using the changeset viewer.