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/JSGlobalObject.h

    r48542 r48774  
    2323#define JSGlobalObject_h
    2424
     25#include "JSArray.h"
    2526#include "JSGlobalData.h"
    2627#include "JSVariableObject.h"
     
    344345    }
    345346
    346     inline JSGlobalObject* ScopeChainNode::globalObject() const
    347     {
    348         const ScopeChainNode* n = this;
    349         while (n->next)
    350             n = n->next;
    351         return asGlobalObject(n->object);
    352     }
    353 
    354347    inline JSValue Structure::prototypeForLookup(ExecState* exec) const
    355348    {
     
    406399    }
    407400
     401    inline JSObject* constructEmptyObject(ExecState* exec)
     402    {
     403        return new (exec) JSObject(exec->lexicalGlobalObject()->emptyObjectStructure());
     404    }
     405
     406    inline JSArray* constructEmptyArray(ExecState* exec)
     407    {
     408        return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure());
     409    }
     410
     411    inline JSArray* constructEmptyArray(ExecState* exec, unsigned initialLength)
     412    {
     413        return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), initialLength);
     414    }
     415
     416    inline JSArray* constructArray(ExecState* exec, JSValue singleItemValue)
     417    {
     418        MarkedArgumentBuffer values;
     419        values.append(singleItemValue);
     420        return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), values);
     421    }
     422
     423    inline JSArray* constructArray(ExecState* exec, const ArgList& values)
     424    {
     425        return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), values);
     426    }
     427
    408428    class DynamicGlobalObjectScope : public Noncopyable {
    409429    public:
Note: See TracChangeset for help on using the changeset viewer.