Ignore:
Timestamp:
Sep 2, 2011, 1:41:59 PM (14 years ago)
Author:
[email protected]
Message:

Use bump allocator for initial property storage
https://bugs.webkit.org/show_bug.cgi?id=67494

Reviewed by Gavin Barraclough.

Switch to a bump allocator for the initial out of line
property storage. This gives us slightly faster allocation
for short lived objects that need out of line storage at
the cost of an additional memcpy when the object survives
a GC pass.

No performance impact.

(JSC::Heap::collect):

  • heap/Heap.h:

(JSC::Heap::allocatePropertyStorage):
(JSC::Heap::inPropertyStorageNursary):

  • heap/NewSpace.cpp:

(JSC::NewSpace::NewSpace):

  • heap/NewSpace.h:

(JSC::NewSpace::resetPropertyStorageNursary):
(JSC::NewSpace::allocatePropertyStorage):
(JSC::NewSpace::inPropertyStorageNursary):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/JSObject.cpp:

(JSC::JSObject::allocatePropertyStorage):

  • runtime/JSObject.h:

(JSC::JSObject::~JSObject):
(JSC::JSObject::putDirectInternal):
(JSC::JSObject::putDirectWithoutTransition):
(JSC::JSObject::putDirectFunctionWithoutTransition):
(JSC::JSObject::transitionTo):
(JSC::JSObject::visitChildrenDirect):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r93918 r94445  
    9292        void collectAllGarbage();
    9393
     94        inline void* allocatePropertyStorage(size_t);
     95        inline bool inPropertyStorageNursery(void*);
     96
    9497        void reportExtraMemoryCost(size_t cost);
    9598
     
    359362    }
    360363
     364    inline void* Heap::allocatePropertyStorage(size_t bytes)
     365    {
     366        ASSERT(!(bytes % sizeof(JSValue)));
     367        if (bytes >= NewSpace::PropertyStorageNurserySize)
     368            return fastMalloc(bytes);
     369        if (void* result = m_newSpace.allocatePropertyStorage(bytes))
     370            return result;
     371        collect(DoNotSweep);
     372        return m_newSpace.allocatePropertyStorage(bytes);
     373    }
     374   
     375    inline bool Heap::inPropertyStorageNursery(void* ptr)
     376    {
     377        return m_newSpace.inPropertyStorageNursery(ptr);
     378    }
     379
    361380} // namespace JSC
    362381
Note: See TracChangeset for help on using the changeset viewer.