Ignore:
Timestamp:
Sep 9, 2008, 4:42:47 PM (17 years ago)
Author:
[email protected]
Message:

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

Reviewed by Geoffrey Garen.

Replace uses of PropertyMap::get and PropertyMap::getLocation with
PropertyMap::getOffset.

Sunspider reports this as a .6% improvement.

  • JavaScriptCore.exp:
  • kjs/JSObject.cpp: (JSC::JSObject::put): (JSC::JSObject::deleteProperty): (JSC::JSObject::getPropertyAttributes):
  • kjs/JSObject.h: (JSC::JSObject::getDirect): (JSC::JSObject::getDirectLocation): (JSC::JSObject::locationForOffset):
  • kjs/PropertyMap.cpp: (JSC::PropertyMap::remove): (JSC::PropertyMap::getOffset):
  • kjs/PropertyMap.h:
File:
1 edited

Legend:

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

    r36285 r36304  
    137137   
    138138    unsigned attributes;
    139     if (m_structureID->propertyMap().get(propertyName, attributes, m_propertyStorage) && attributes & ReadOnly)
     139    if ((m_structureID->propertyMap().getOffset(propertyName, attributes) != WTF::notFound) && attributes & ReadOnly)
    140140        return;
    141141
    142142    for (JSObject* obj = this; ; obj = static_cast<JSObject*>(prototype)) {
    143         if (JSValue* gs = obj->structureID()->propertyMap().get(propertyName, obj->propertyStorage())) {
     143        if (JSValue* gs = obj->getDirect(propertyName)) {
    144144            if (gs->isGetterSetter()) {
    145145                JSObject* setterFunc = static_cast<GetterSetter*>(gs)->setter();       
     
    203203{
    204204    unsigned attributes;
    205     JSValue* v = m_structureID->propertyMap().get(propertyName, attributes, m_propertyStorage);
    206     if (v) {
     205    if (m_structureID->propertyMap().getOffset(propertyName, attributes) != WTF::notFound) {
    207206        if ((attributes & DontDelete))
    208207            return false;
     
    422421bool JSObject::getPropertyAttributes(ExecState* exec, const Identifier& propertyName, unsigned& attributes) const
    423422{
    424     if (m_structureID->propertyMap().get(propertyName, attributes, m_propertyStorage))
     423    if (m_structureID->propertyMap().getOffset(propertyName, attributes) != WTF::notFound)
    425424        return true;
    426425   
Note: See TracChangeset for help on using the changeset viewer.