Ignore:
Timestamp:
Oct 16, 2008, 7:57:02 PM (17 years ago)
Author:
[email protected]
Message:

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

Reviewed by Maciej Stachowiak.

Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
Don't create intermediate StructureIDs for builtin objects

First step in reduce number of StructureIDs created when initializing the
JSGlobalObject.

  • In order to avoid creating the intermediate StructureIDs use the new putDirectWithoutTransition and putDirectFunctionWithoutTransition to add properties to JSObjects without transitioning the StructureID. This patch just implements this strategy for ObjectPrototype but alone reduces the number of StructureIDs create for about:blank by 10, from 142 to 132.
  • kjs/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset):
  • kjs/JSObject.cpp: (JSC::JSObject::putDirectFunctionWithoutTransition):
  • kjs/JSObject.h: (JSC::JSObject::putDirectWithoutTransition):
  • kjs/ObjectPrototype.cpp: (JSC::ObjectPrototype::ObjectPrototype):
  • kjs/ObjectPrototype.h:
  • kjs/StructureID.cpp: (JSC::StructureID::addPropertyWithoutTransition):
  • kjs/StructureID.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/StructureID.cpp

    r37632 r37645  
    318318}
    319319
     320size_t StructureID::addPropertyWithoutTransition(const Identifier& propertyName, unsigned attributes)
     321{
     322    size_t offset = m_propertyMap.put(propertyName, attributes);
     323    if (m_propertyMap.storageSize() > propertyStorageCapacity())
     324        growPropertyStorageCapacity();
     325    return offset;
     326}
     327
    320328StructureIDChain* StructureID::createCachedPrototypeChain()
    321329{
Note: See TracChangeset for help on using the changeset viewer.