Ignore:
Timestamp:
Feb 28, 2016, 9:26:05 PM (9 years ago)
Author:
[email protected]
Message:

Make JSFunction.name allocation fully lazy.
<https://webkit.org/b/154806>

Reviewed by Saam Barati.

We were reifying the "name" field on functions lazily, but created the string
value itself up front. This patch gets rid of the up-front allocation,
saving us a JSString allocation per function in most cases.

  • builtins/BuiltinExecutables.cpp:

(JSC::createExecutableInternal):

  • bytecode/UnlinkedFunctionExecutable.cpp:

(JSC::UnlinkedFunctionExecutable::visitChildren):

  • bytecode/UnlinkedFunctionExecutable.h:
  • runtime/CodeCache.cpp:

(JSC::CodeCache::getFunctionExecutableFromGlobalCode):

  • runtime/Executable.h:
  • runtime/JSFunction.cpp:

(JSC::JSFunction::reifyName):

File:
1 edited

Legend:

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

    r195876 r197308  
    668668    const Identifier& name() { return m_unlinkedExecutable->name(); }
    669669    const Identifier& inferredName() { return m_unlinkedExecutable->inferredName(); }
    670     JSString* nameValue() const { return m_unlinkedExecutable->nameValue(); }
    671670    size_t parameterCount() const { return m_unlinkedExecutable->parameterCount(); } // Excluding 'this'!
    672671    SourceParseMode parseMode() const { return m_unlinkedExecutable->parseMode(); }
Note: See TracChangeset for help on using the changeset viewer.