• fpizlo@apple.com's avatar
    JSObject fast by-string access optimizations should work even on the prototype... · 10c38d3c
    fpizlo@apple.com authored
    JSObject fast by-string access optimizations should work even on the prototype chain, and even when the result is undefined
    Reviewed by Oliver Hunt.
    Extended the existing fast access path for String keys to work over the entire prototype chain,
    not just the self access case. This will fail as soon as it sees an object that intercepts
    getOwnPropertySlot, so this patch also ensures that ObjectPrototype does not fall into that
    category. This is accomplished by making ObjectPrototype eagerly reify all of its properties.
    This is safe for ObjectPrototype because it's so common and we expect all of its properties to
    be reified for any interesting programs anyway. A new idiom for adding native functions to
    prototypes is introduced, which ought to work well for any other prototypes that we wish to do
    this conversion for.
    This is a >60% speed-up in the case that you frequently do by-string lookups that "miss", i.e.
    they don't turn up anything.
    * CMakeLists.txt:
    * DerivedSources.make:
    * DerivedSources.pri:
    * GNUmakefile.list.am:
    * dfg/DFGOperations.cpp:
    * interpreter/CallFrame.h:
    * jit/JITStubs.cpp:
    * llint/LLIntSlowPaths.cpp:
    * runtime/CommonIdentifiers.h:
    * runtime/JSCell.cpp:
    * runtime/JSCell.h:
    * runtime/JSCellInlines.h:
    * runtime/JSGlobalData.cpp:
    * runtime/JSGlobalData.h:
    * runtime/JSObject.cpp:
    * runtime/JSObject.h:
    * runtime/Lookup.cpp:
    * runtime/ObjectPrototype.cpp:
    * runtime/ObjectPrototype.h:
    * runtime/PropertyMapHashTable.h:
    * runtime/Structure.h:
    * runtime/StructureInlines.h:
    Reviewed by Oliver Hunt.
    * fast/js/regress/script-tests/string-lookup-hit-identifier.js: Added.
    * fast/js/regress/script-tests/string-lookup-hit.js: Added.
    * fast/js/regress/script-tests/string-lookup-miss.js: Added.
    * fast/js/regress/string-lookup-hit-expected.txt: Added.
    * fast/js/regress/string-lookup-hit-identifier-expected.txt: Added.
    * fast/js/regress/string-lookup-hit-identifier.html: Added.
    * fast/js/regress/string-lookup-hit.html: Added.
    * fast/js/regress/string-lookup-miss-expected.txt: Added.
    * fast/js/regress/string-lookup-miss.html: Added.
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
string-lookup-miss-expected.txt 188 Bytes