Ignore:
Timestamp:
Sep 25, 2009, 3:26:44 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore: Inlined some object creation code, including lexicalGlobalObject access
https://bugs.webkit.org/show_bug.cgi?id=29750

Patch by Geoffrey Garen <[email protected]> on 2009-09-25
Reviewed by Darin Adler.

SunSpider says 0.5% faster.

0.8% speedup on bench-alloc-nonretained.js.
2.5% speedup on v8-splay.js.

  • interpreter/CachedCall.h:

(JSC::CachedCall::CachedCall):

  • interpreter/CallFrame.h:

(JSC::ExecState::lexicalGlobalObject):
(JSC::ExecState::globalThisValue):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::dumpRegisters):
(JSC::Interpreter::execute):
(JSC::Interpreter::privateExecute):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/FunctionConstructor.cpp:

(JSC::constructFunction):

  • runtime/ScopeChain.cpp:

(JSC::ScopeChainNode::print):

  • runtime/ScopeChain.h:

(JSC::ScopeChainNode::ScopeChainNode):
(JSC::ScopeChainNode::~ScopeChainNode):
(JSC::ScopeChainNode::push):
(JSC::ScopeChain::ScopeChain):
(JSC::ScopeChain::globalObject): Added a globalObject data member to ScopeChainNode.
Replaced accessor function for globalObject() with data member. Replaced
globalThisObject() accessor with direct access to globalThis, to match.

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):

  • runtime/JSGlobalObject.h: Inlined array and object construction.

WebCore: Inlined some object creation code, including lexicalGlobalObject access
https://bugs.webkit.org/show_bug.cgi?id=29750

Patch by Geoffrey Garen <[email protected]> on 2009-09-25
Reviewed by Darin Adler.

  • bindings/js/JSInspectorBackendCustom.cpp:

(WebCore::JSInspectorBackend::currentCallFrame):

  • inspector/JavaScriptDebugServer.cpp:

(WebCore::JavaScriptDebugServer::hasBreakpoint): Updated for JavaScriptCore
API changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/ScopeChain.h

    r47025 r48774  
    3434    class ScopeChainNode : public FastAllocBase {
    3535    public:
    36         ScopeChainNode(ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSObject* globalThis)
     36        ScopeChainNode(ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis)
    3737            : next(next)
    3838            , object(object)
    3939            , globalData(globalData)
     40            , globalObject(globalObject)
    4041            , globalThis(globalThis)
    4142            , refCount(1)
    4243        {
    4344            ASSERT(globalData);
     45            ASSERT(globalObject);
    4446        }
    4547#ifndef NDEBUG
     
    5254            object = 0;
    5355            globalData = 0;
     56            globalObject = 0;
    5457            globalThis = 0;
    5558        }
     
    5962        JSObject* object;
    6063        JSGlobalData* globalData;
     64        JSGlobalObject* globalObject;
    6165        JSObject* globalThis;
    6266        int refCount;
     
    8387        ScopeChainIterator end() const;
    8488
    85         JSGlobalObject* globalObject() const; // defined in JSGlobalObject.h
    86         JSObject* globalThisObject() const { return globalThis; }
    87 
    8889#ifndef NDEBUG       
    8990        void print() const;
     
    9495    {
    9596        ASSERT(o);
    96         return new ScopeChainNode(this, o, globalData, globalThis);
     97        return new ScopeChainNode(this, o, globalData, globalObject, globalThis);
    9798    }
    9899
     
    164165        }
    165166
    166         ScopeChain(JSObject* o, JSGlobalData* globalData, JSObject* globalThis)
    167             : m_node(new ScopeChainNode(0, o, globalData, globalThis))
     167        ScopeChain(JSObject* o, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis)
     168            : m_node(new ScopeChainNode(0, o, globalData, globalObject, globalThis))
    168169        {
    169170        }
     
    204205        void clear() { m_node->deref(); m_node = 0; }
    205206       
    206         JSGlobalObject* globalObject() const { return m_node->globalObject(); }
     207        JSGlobalObject* globalObject() const { return m_node->globalObject; }
    207208
    208209        void markAggregate(MarkStack&) const;
Note: See TracChangeset for help on using the changeset viewer.