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/JSFunction.cpp

    r197205 r197308  
    590590    ASSERT(!hasReifiedName());
    591591    ASSERT(!isHostFunction());
    592     JSValue initialValue = jsExecutable()->nameValue();
    593592    unsigned initialAttributes = DontEnum | ReadOnly;
    594593    const Identifier& identifier = exec->propertyNames().name;
    595     putDirect(vm, identifier, initialValue, initialAttributes);
     594    putDirect(vm, identifier, jsString(exec, jsExecutable()->name().string()), initialAttributes);
    596595
    597596    rareData->setHasReifiedName();
Note: See TracChangeset for help on using the changeset viewer.