Ignore:
Timestamp:
Sep 8, 2011, 3:52:04 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 Geoffrey Garen.

../../../../Volumes/Data/git/WebKit/OpenSource/Source/JavaScriptCore:

Use a bump allocator for initial allocation of property storage,
and promote to fastMalloc memory only if it survives a GC pass.

Comes out as a 1% win on v8, and is a useful step on the way to
GC allocation of all property storage.

(JSC::Heap::collect):

  • heap/Heap.h:

(JSC::Heap::allocatePropertyStorage):
(JSC::Heap::inPropertyStorageNursery):

  • heap/MarkedBlock.h:
  • heap/NewSpace.cpp:

(JSC::NewSpace::NewSpace):

  • heap/NewSpace.h:

(JSC::NewSpace::resetPropertyStorageNursery):
(JSC::NewSpace::allocatePropertyStorage):
(JSC::NewSpace::inPropertyStorageNursery):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/JSObject.cpp:

(JSC::JSObject::allocatePropertyStorage):

  • runtime/JSObject.h:

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

  • runtime/StorageBarrier.h: Added.

(JSC::StorageBarrier::StorageBarrier):
(JSC::StorageBarrier::set):
(JSC::StorageBarrier::operator->):
(JSC::StorageBarrier::operator*):
(JSC::StorageBarrier::operator[]):
(JSC::StorageBarrier::get):

../../../../Volumes/Data/git/WebKit/OpenSource/Source/WebCore:

Add a forwarding header.

  • ForwardingHeaders/runtime/StorageBarrier.h: Added.
File:
1 edited

Legend:

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

    r94522 r94814  
    9292        void collectAllGarbage();
    9393
     94        inline void* allocatePropertyStorage(size_t);
     95        inline bool inPropertyStorageNursery(void*);
     96
    9497        void reportExtraMemoryCost(size_t cost);
    9598
     
    164167
    165168        static void writeBarrierSlowCase(const JSCell*, JSCell*);
    166        
     169
    167170#if ENABLE(LAZY_BLOCK_FREEING)
    168171        void waitForRelativeTimeWhileHoldingLock(double relative);
     
    360363    }
    361364
     365    inline void* Heap::allocatePropertyStorage(size_t bytes)
     366    {
     367        ASSERT(!(bytes % sizeof(JSValue)));
     368        if (bytes >= NewSpace::PropertyStorageNurserySize)
     369            return 0;
     370        if (void* result = m_newSpace.allocatePropertyStorage(bytes))
     371            return result;
     372        collect(DoNotSweep);
     373        return m_newSpace.allocatePropertyStorage(bytes);
     374    }
     375   
     376    inline bool Heap::inPropertyStorageNursery(void* ptr)
     377    {
     378        return m_newSpace.inPropertyStorageNursery(ptr);
     379    }
     380
    362381} // namespace JSC
    363382
Note: See TracChangeset for help on using the changeset viewer.