Ignore:
Timestamp:
Aug 6, 2011, 8:44:45 PM (14 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=65821
Don't form identifiers the first time a string is used as a property name.

Reviewed by Oliver Hunt.

This is a 1% win on SunSpider.

  • dfg/DFGOperations.cpp:
    • Use fastGetOwnProperty.
  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • Use fastGetOwnProperty.
  • runtime/JSCell.h:
  • runtime/JSObject.h:

(JSC::JSCell::fastGetOwnProperty):

  • Fast call to get a property without creating an identifier the first time.
  • runtime/PropertyMapHashTable.h:

(JSC::PropertyTable::find):
(JSC::PropertyTable::findWithString):

  • Add interface to look up by either strinsg or identifiers.
  • runtime/Structure.h:

(JSC::Structure::get):

  • Add a get() call that takes a UString, not an Identifier.
  • wtf/text/StringImpl.h:

(WTF::StringImpl::hasHash):

  • Add a call to check if the has has been set (to detect the first use as a property name).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r91883 r92569  
    211211                return getByVal(exec, base, propertyAsUInt32);
    212212        } else if (property.isString()) {
    213             Identifier propertyName(exec, asString(property)->value(exec));
    214             PropertySlot slot(base);
    215             if (base->fastGetOwnPropertySlot(exec, propertyName, slot))
    216                 return JSValue::encode(slot.getValue(exec, propertyName));
     213            if (JSValue result = base->fastGetOwnProperty(exec, asString(property)->value(exec)))
     214                return JSValue::encode(result);
    217215        }
    218216    }
Note: See TracChangeset for help on using the changeset viewer.