Ignore:
Timestamp:
Aug 2, 2011, 5:41:11 PM (14 years ago)
Author:
[email protected]
Message:

Simplify JSFunction creation for functions written in JS
https://bugs.webkit.org/show_bug.cgi?id=65422

Reviewed by Gavin Barraclough.

Remove hash lookups used to write name property and transition
function structure by caching the resultant structure and property
offset in JSGlobalObject. This doesn't impact performance, but
we can use this change to make other improvements later.

  • runtime/Executable.cpp:

(JSC::FunctionExecutable::FunctionExecutable):

  • runtime/Executable.h:

(JSC::ScriptExecutable::ScriptExecutable):
(JSC::FunctionExecutable::jsName):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::JSFunction):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::reset):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::namedFunctionStructure):
(JSC::JSGlobalObject::functionNameOffset):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Executable.h

    r91883 r92250  
    227227#if ENABLE(CODEBLOCK_SAMPLING)
    228228            if (SamplingTool* sampler = globalData.interpreter->sampler())
    229                 sampler->notifyOfScope(*globalData, this);
     229                sampler->notifyOfScope(globalData, this);
    230230#else
    231231            UNUSED_PARAM(globalData);
     
    479479
    480480        const Identifier& name() { return m_name; }
     481        JSString* nameValue() const { return m_nameValue.get(); }
    481482        size_t parameterCount() const { return m_parameters->size(); }
    482483        unsigned capturedVariableCount() const { return m_numCapturedVariables; }
     
    510511        OwnPtr<FunctionCodeBlock> m_codeBlockForConstruct;
    511512        Identifier m_name;
     513        WriteBarrier<JSString> m_nameValue;
    512514        SharedSymbolTable* m_symbolTable;
    513515    };
Note: See TracChangeset for help on using the changeset viewer.