Changeset 36325 in webkit for trunk/JavaScriptCore/VM/CTI.cpp


Ignore:
Timestamp:
Sep 10, 2008, 7:42:18 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-10 Sam Weinig <[email protected]>

Reviewed by Geoff Garen.

Add inline property storage for JSObject.

1.2% progression on Sunspider. .5% progression on the v8 test suite.

  • JavaScriptCore.exp:
  • VM/CTI.cpp: (JSC::CTI::privateCompileGetByIdProto): (JSC::CTI::privateCompileGetByIdChain):
  • kjs/JSObject.cpp: (JSC::JSObject::mark): There is no reason to check storageSize now that we start from 0. (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
  • kjs/JSObject.h: (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr now so there is no reason to .get() (JSC::JSObject::usingInlineStorage): (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the inline storage. (JSC::JSObject::~JSObject): Free the heap storage if not using the inline storage. (JSC::JSObject::putDirect): Switch to the heap storage only when we know we know that we are about to add a property that will overflow the inline storage.
  • kjs/PropertyMap.cpp: (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is now handled by JSObject. (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
  • kjs/PropertyMap.h: (JSC::PropertyMap::storageSize): Rename from markingCount.
  • kjs/StructureID.cpp: (JSC::StructureID::addPropertyTransition): Don't resize the property storage if we are using inline storage.
  • kjs/StructureID.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CTI.cpp

    r36324 r36325  
    17381738    // referencing the prototype object - let's speculatively load it's table nice and early!)
    17391739    JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(exec));
    1740     OwnArrayPtr<JSValue*>* protoPropertyStorage = &protoObject->m_propertyStorage;
     1740    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    17411741    m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
    17421742
     
    17831783    StructureID* currStructureID = structureID;
    17841784    RefPtr<StructureID>* chainEntries = chain->head();
    1785     JSCell* protoObject = 0;
     1785    JSObject* protoObject = 0;
    17861786    for (unsigned i = 0; i<count; ++i) {
    1787         protoObject = static_cast<JSCell*>(currStructureID->prototypeForLookup(exec));
     1787        protoObject = static_cast<JSObject*>(currStructureID->prototypeForLookup(exec));
    17881788        currStructureID = chainEntries[i].get();
    17891789
     
    17941794    }
    17951795    ASSERT(protoObject);
    1796  
    1797     OwnArrayPtr<JSValue*>* protoPropertyStorage = &static_cast<JSObject*>(protoObject)->m_propertyStorage;
     1796
     1797    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    17981798    m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
    17991799    m_jit.movl_mr(cachedOffset * sizeof(JSValue*), X86::edx, X86::eax);
Note: See TracChangeset for help on using the changeset viewer.