Ignore:
Timestamp:
Mar 18, 2008, 2:42:58 AM (17 years ago)
Author:
[email protected]
Message:

2008-03-18 Maciej Stachowiak <[email protected]>

Reviewed by Oliver.


  • a few micro-optimizations for 1.2% SunSpider speedup
  • kjs/function.cpp: (KJS::FunctionImp::callAsFunction): check for Return completion before Throw, it is more likely.
  • kjs/object.cpp: (KJS::JSObject::put): When walking prototype chain, instead of checking isObject (a virtual call), compare to jsNull (compare to a constant) since null is the only non-object that can be in a prototype chain.
File:
1 edited

Legend:

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

    r31114 r31121  
    7575    FunctionExecState newExec(exec->dynamicGlobalObject(), thisObj, body.get(), exec, this, args);
    7676    JSValue* result = body->execute(&newExec);
     77    if (newExec.completionType() == ReturnValue)
     78        return result;
    7779    if (newExec.completionType() == Throw) {
    7880        exec->setException(result);
    7981        return result;
    8082    }
    81     if (newExec.completionType() == ReturnValue)
    82         return result;
    8383    return jsUndefined();
    8484}
Note: See TracChangeset for help on using the changeset viewer.