Ignore:
Timestamp:
Mar 27, 2009, 8:50:39 PM (16 years ago)
Author:
[email protected]
Message:

Improve performance of Function.prototype.call
<https://bugs.webkit.org/show_bug.cgi?id=24907>

Reviewed by Gavin Barraclough

Optimistically assume that expression.call(..) is going to be a call to
Function.prototype.call, and handle it specially to attempt to reduce the
degree of VM reentrancy.

When everything goes right this removes the vm reentry improving .call()
by around a factor of 10.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSGlobalObject.cpp

    r41846 r42065  
    204204    d()->functionPrototype = new (exec) FunctionPrototype(exec, FunctionPrototype::createStructure(jsNull())); // The real prototype will be set once ObjectPrototype is created.
    205205    d()->prototypeFunctionStructure = PrototypeFunction::createStructure(d()->functionPrototype);
    206     d()->functionPrototype->addFunctionProperties(exec, d()->prototypeFunctionStructure.get());
     206    PrototypeFunction* callFunction = 0;
     207    d()->functionPrototype->addFunctionProperties(exec, d()->prototypeFunctionStructure.get(), &callFunction);
     208    d()->callFunction = callFunction;
    207209    d()->objectPrototype = new (exec) ObjectPrototype(exec, ObjectPrototype::createStructure(jsNull()), d()->prototypeFunctionStructure.get());
    208210    d()->functionPrototype->structure()->setPrototypeWithoutTransition(d()->objectPrototype);
     
    371373
    372374    markIfNeeded(d()->evalFunction);
     375    markIfNeeded(d()->callFunction);
    373376
    374377    markIfNeeded(d()->objectPrototype);
Note: See TracChangeset for help on using the changeset viewer.