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

    r92058 r92250  
    117117        WriteBarrier<Structure> m_errorStructure;
    118118        WriteBarrier<Structure> m_functionStructure;
     119        WriteBarrier<Structure> m_namedFunctionStructure;
     120        size_t m_functionNameOffset;
    119121        WriteBarrier<Structure> m_numberObjectStructure;
    120122        WriteBarrier<Structure> m_regExpMatchesArrayStructure;
     
    230232        Structure* errorStructure() const { return m_errorStructure.get(); }
    231233        Structure* functionStructure() const { return m_functionStructure.get(); }
     234        Structure* namedFunctionStructure() const { return m_namedFunctionStructure.get(); }
     235        size_t functionNameOffset() const { return m_functionNameOffset; }
    232236        Structure* numberObjectStructure() const { return m_numberObjectStructure.get(); }
    233237        Structure* internalFunctionStructure() const { return m_internalFunctionStructure.get(); }
Note: See TracChangeset for help on using the changeset viewer.