Ignore:
Timestamp:
Jan 1, 2008, 11:35:37 AM (17 years ago)
Author:
Darin Adler
Message:

Reviewed by Geoff.

Also included one other speed-up -- remove the call to reserveCapacity from
FunctionBodyNode::processDeclarations in all but the most unusual cases.

Together these make SunSpider 1.016x as fast.

  • JavaScriptCore.exp: Updated.
  • kjs/ExecState.cpp: (KJS::globalEmptyList): Added. Called only when creating global ExecState instances. (KJS::ExecState::ExecState): Broke constructor up into three separate functions, for the three separate node types. Also went through each of the three and streamlined as much as possible, removing dead code. This prevents us from having to access the global in the function body version of the constructor.
  • kjs/ExecState.h: Added emptyList(). Replaced the constructor with a set of three that are specific to the different node types that can create new execution state objects.
  • kjs/array_object.cpp: (KJS::ArrayProtoFuncToLocaleString::callAsFunction): Use exec->emptyList() instead of List::empty(). (KJS::ArrayProtoFuncConcat::callAsFunction): Ditto. (KJS::ArrayProtoFuncSlice::callAsFunction): Ditto. (KJS::ArrayProtoFuncSplice::callAsFunction): Ditto. (KJS::ArrayProtoFuncFilter::callAsFunction): Ditto.
  • kjs/function.cpp: (KJS::FunctionImp::callAsFunction): Updated to call new ExecState constructor. (KJS::GlobalFuncImp::callAsFunction): Ditto (for eval).
  • kjs/function_object.cpp: (FunctionObjectImp::construct): Use exec->emptyList() instead of List::empty().
  • kjs/list.cpp: Removed List::empty.
  • kjs/list.h: Ditto.
  • kjs/nodes.cpp: (KJS::ElementNode::evaluate): Use exec->emptyList() instead of List::empty(). (KJS::ArrayNode::evaluate): Ditto. (KJS::ObjectLiteralNode::evaluate): Ditto. (KJS::PropertyListNode::evaluate): Ditto. (KJS::FunctionBodyNode::processDeclarations): Another speed-up. Check the capacity before calling reserveCapacity, because it doesn't get inlined the local storage vector is almost always big enough -- saving the function call overhead is a big deal. (KJS::FuncDeclNode::makeFunction): Use exec->emptyList() instead of List::empty(). (KJS::FuncExprNode::evaluate): Ditto.
  • kjs/object.cpp: (KJS::tryGetAndCallProperty): Ditto.
  • kjs/property_slot.cpp: (KJS::PropertySlot::functionGetter): Ditto.
  • kjs/string_object.cpp: (KJS::StringProtoFuncSplit::callAsFunction): Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/array_object.cpp

    r29047 r29067  
    161161        JSValue* conversionFunction = o->get(exec, exec->propertyNames().toLocaleString);
    162162        if (conversionFunction->isObject() && static_cast<JSObject*>(conversionFunction)->implementsCall())
    163             str += static_cast<JSObject*>(conversionFunction)->call(exec, o, List::empty())->toString(exec);
     163            str += static_cast<JSObject*>(conversionFunction)->call(exec, o, exec->emptyList())->toString(exec);
    164164        else
    165165            str += element->toString(exec);
     
    221221JSValue* ArrayProtoFuncConcat::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
    222222{
    223     JSObject* arr = static_cast<JSObject*>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, List::empty()));
     223    JSObject* arr = static_cast<JSObject*>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, exec->emptyList()));
    224224    int n = 0;
    225225    JSValue* curArg = thisObj;
     
    328328
    329329    // We return a new array
    330     JSObject* resObj = static_cast<JSObject* >(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, List::empty()));
     330    JSObject* resObj = static_cast<JSObject* >(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, exec->emptyList()));
    331331    JSValue* result = resObj;
    332332    double begin = args[0]->toInteger(exec);
     
    428428{
    429429    // 15.4.4.12
    430     JSObject* resObj = static_cast<JSObject* >(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, List::empty()));
     430    JSObject* resObj = static_cast<JSObject* >(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, exec->emptyList()));
    431431    JSValue* result = resObj;
    432432    unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
     
    497497
    498498    JSObject* applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicGlobalObject() :  args[1]->toObject(exec);
    499     JSObject* resultArray = static_cast<JSObject*>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, List::empty()));
     499    JSObject* resultArray = static_cast<JSObject*>(exec->lexicalGlobalObject()->arrayConstructor()->construct(exec, exec->emptyList()));
    500500
    501501    unsigned filterIndex = 0;
Note: See TracChangeset for help on using the changeset viewer.