JavaScriptCore:
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Sep 2008 02:31:45 +0000 (02:31 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Sep 2008 02:31:45 +0000 (02:31 +0000)
commit36dea16f30b5f96550c10bb00e0536834efe49e1
tree578591094f1b4814ab91d2bf825162d66627670d
parent48d9c6da2c19ad083f2d5c8b99768231b63af570
JavaScriptCore:

2008-09-02  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Sam Weinig.

        Implemented the rest of Darin's review comments for the 09-01 inline
        caching patch.

        SunSpider says 0.5% faster, but that seems like noise.

        * JavaScriptCore.xcodeproj/project.pbxproj: Put PutPropertySlot into
        its own file, and added BatchedTransitionOptimizer.

        * VM/CodeBlock.cpp:
        (KJS::CodeBlock::~CodeBlock): Use array indexing instead of a pointer
        iterator.

        * VM/CodeGenerator.cpp:
        (KJS::CodeGenerator::CodeGenerator): Used BatchedTransitionOptimizer to
        make batched put and remove for declared variables fast, without forever
        pessimizing the global object. Removed the old getDirect/removeDirect hack
        that tried to do the same in a more limited way.

        * VM/CodeGenerator.h: Moved IdentifierRepHash to the KJS namespace since
        it doesn't specialize anything in WTF.

        * VM/Machine.cpp:
        (KJS::Machine::Machine): Nixed the DummyConstruct tag because it was
        confusingly named.

        (KJS::Machine::execute):  Used BatchedTransitionOptimizer, as above. Fixed
        up some comments.

        (KJS::cachePrototypeChain): Cast to JSObject*, since it's more specific.

        (KJS::Machine::tryCachePutByID): Use isNull() instead of comparing to
        jsNull(), since isNull() leaves more options open for the future.
        (KJS::Machine::tryCacheGetByID): ditto
        (KJS::Machine::privateExecute): ditto

        * VM/SamplingTool.cpp:
        (KJS::SamplingTool::dump): Use C++-style cast, to match our style
        guidelines.

        * kjs/BatchedTransitionOptimizer.h: Added. New class that allows host
        code to add a batch of properties to an object in an efficient way.

        * kjs/JSActivation.cpp: Use isNull(), as above.

        * kjs/JSArray.cpp: Get rid of DummyConstruct tag, as above.
        * kjs/JSArray.h:

        * kjs/JSGlobalData.cpp: Nixed two unused StructureIDs.
        * kjs/JSGlobalData.h:

        * kjs/JSImmediate.cpp: Use isNull(), as above.

        * kjs/JSObject.cpp:
        (KJS::JSObject::mark): Moved mark tracing code elsewhere, to make this
        function more readable.

        (KJS::JSObject::put): Use isNull(), as above.

        (KJS::JSObject::createInheritorID): Return a raw pointer, since the
        object is owned by a data member, not necessarily the caller.
        * kjs/JSObject.h:

        * kjs/JSString.cpp: Use isNull(), as above.

        * kjs/PropertyMap.h: Updated to use PropertySlot::invalidOffset.

        * kjs/PropertySlot.h: Changed KJS_INVALID_OFFSET to WTF::notFound
        because C macros are so 80's.

        * kjs/PutPropertySlot.h: Added. Split out of PropertySlot.h. Also renamed
        PutPropertySlot::SlotType to PutPropertySlot::Type, and slotBase to base,
        since "slot" was redundant.

        * kjs/StructureID.cpp: Added a new transition *away* from dictionary
        status, to support BatchedTransitionOptimizer.

        (KJS::StructureIDChain::StructureIDChain): No need to store m_size as
        a data member, so keep it in a local, which might be faster.
        * kjs/StructureID.h:

        * kjs/SymbolTable.h: Moved IdentifierRepHash to KJS namespace, as above.
        * kjs/ustring.h:

JavaScriptGlue:

2008-09-02  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Sam Weinig.

        Implemented the rest of Darin's review comments for the 09-01 inline
        caching patch.

        * ForwardingHeaders/kjs/PutPropertySlot.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@36032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/VM/CodeBlock.cpp
JavaScriptCore/VM/CodeGenerator.cpp
JavaScriptCore/VM/CodeGenerator.h
JavaScriptCore/VM/Machine.cpp
JavaScriptCore/VM/SamplingTool.cpp
JavaScriptCore/kjs/BatchedTransitionOptimizer.h [new file with mode: 0644]
JavaScriptCore/kjs/JSActivation.cpp
JavaScriptCore/kjs/JSArray.cpp
JavaScriptCore/kjs/JSArray.h
JavaScriptCore/kjs/JSGlobalData.cpp
JavaScriptCore/kjs/JSGlobalData.h
JavaScriptCore/kjs/JSImmediate.cpp
JavaScriptCore/kjs/JSObject.cpp
JavaScriptCore/kjs/JSObject.h
JavaScriptCore/kjs/JSString.cpp
JavaScriptCore/kjs/PropertyMap.cpp
JavaScriptCore/kjs/PropertyMap.h
JavaScriptCore/kjs/PropertySlot.h
JavaScriptCore/kjs/PutPropertySlot.h [new file with mode: 0644]
JavaScriptCore/kjs/StructureID.cpp
JavaScriptCore/kjs/StructureID.h
JavaScriptCore/kjs/SymbolTable.h
JavaScriptCore/kjs/ustring.h
JavaScriptGlue/ChangeLog
JavaScriptGlue/ForwardingHeaders/kjs/PutPropertySlot.h [new file with mode: 0644]
JavaScriptGlue/ForwardingHeaders/wtf/NotFound.h [new file with mode: 0644]