Ignore:
Timestamp:
Aug 13, 2009, 10:35:33 PM (16 years ago)
Author:
[email protected]
Message:

Devirtualise marking
https://bugs.webkit.org/show_bug.cgi?id=28294

Reviewed by Maciej Stachowiak.

Add a bit to TypeInfo to indicate that an object uses the standard
JSObject::markChildren method. This allows us to devirtualise marking
of most objects (though a branch is still needed). We also add a branch
to identify arrays thus devirtualising marking in that case as well.

In order to make the best use of this devirtualisation I've also reworked
the MarkStack::drain() logic to make the iteration more efficient.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSObject.h

    r47022 r47267  
    2828#include "CommonIdentifiers.h"
    2929#include "CallFrame.h"
     30#include "JSCell.h"
    3031#include "JSNumberCell.h"
     32#include "MarkStack.h"
    3133#include "PropertySlot.h"
    3234#include "PutPropertySlot.h"
     
    7577
    7678        virtual void markChildren(MarkStack&);
     79        ALWAYS_INLINE void markChildrenDirect(MarkStack& markStack);
    7780
    7881        // The inline virtual destructor cannot be the first virtual function declared
     
    202205        static PassRefPtr<Structure> createStructure(JSValue prototype)
    203206        {
    204             return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot));
     207            return Structure::create(prototype, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark));
    205208        }
    206209
     
    628631}
    629632
     633ALWAYS_INLINE void JSObject::markChildrenDirect(MarkStack& markStack)
     634{
     635    JSCell::markChildren(markStack);
     636    m_structure->markAggregate(markStack);
     637   
     638    PropertyStorage storage = propertyStorage();
     639    size_t storageSize = m_structure->propertyStorageSize();
     640    markStack.appendValues(reinterpret_cast<JSValue*>(storage), storageSize);
     641}
     642
    630643} // namespace JSC
    631644
Note: See TracChangeset for help on using the changeset viewer.