Reviewed by Richard.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2005 01:26:26 +0000 (01:26 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2005 01:26:26 +0000 (01:26 +0000)
commit1f06baf91f2efc8400ffa2ac51b7166b70f13764
tree9c087403aecbd093a36343f00c2b4116e7e0e2d8
parent01e4a67b061faa066d1d447bb352077bee579188
    Reviewed by Richard.

<rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator

- use custom single-threaded malloc for all non-GC JavaScriptCore
allocations, for a 9.1% speedup on JavaScript iBench

        * JavaScriptCore.pbproj/project.pbxproj:
        * kjs/collector.cpp:
        (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
        (KJS::Collector::collect): And dlfree to free it.
        * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
        * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
macro to give a class custom operator new/delete
        * kjs/identifier.cpp:
        (KJS::Identifier::add): Use dlmalloc/dlfree.
        * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
        * kjs/property_map.cpp:
        (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
        (KJS::PropertyMap::rehash): ditto
        * kjs/scope_chain.h:
        * kjs/ustring.cpp:
        (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
buffer, to hide allocation details from webcore.
        (KJS::UString::UString): use createCopying when appropriate.
        (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
        (KJS::UString::expandedSize): likewise
        (KJS::UString::expandCapacity): likewise
        (KJS::UString::expandPreCapacity): likewise
        (KJS::UString::spliceSubstringsWithSeparators): likewise
        (KJS::UString::append): likewise
        (KJS::UString::operator=): likewise
        (KJS::UString::detach): likewise
        * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
JavaScriptCore/kjs/collector.cpp
JavaScriptCore/kjs/fast_malloc.cpp [new file with mode: 0644]
JavaScriptCore/kjs/fast_malloc.h [new file with mode: 0644]
JavaScriptCore/kjs/identifier.cpp
JavaScriptCore/kjs/nodes.h
JavaScriptCore/kjs/property_map.cpp
JavaScriptCore/kjs/scope_chain.h
JavaScriptCore/kjs/ustring.cpp
JavaScriptCore/kjs/ustring.h