Ignore:
Timestamp:
Dec 4, 2017, 11:51:33 PM (7 years ago)
Author:
[email protected]
Message:

Math: don't redundantly check for exceptions, just release scope
https://bugs.webkit.org/show_bug.cgi?id=180395

Rubber stamped by Mark Lam.

Two of the exceptions checks could just have been exception scope
releases before the return, which is ever-so-slightly more
efficient. The same technically applies where we have loops over
parameters, but doing the scope release there isn't really more
efficient and is way harder to read.

  • runtime/MathObject.cpp:

(JSC::mathProtoFuncATan2):
(JSC::mathProtoFuncPow):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/MathObject.cpp

    r225443 r225519  
    154154    double arg0 = exec->argument(0).toNumber(exec);
    155155    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     156    scope.release();
    156157    double arg1 = exec->argument(1).toNumber(exec);
    157     RETURN_IF_EXCEPTION(scope, encodedJSValue());
    158158    return JSValue::encode(jsDoubleNumber(atan2(arg0, arg1)));
    159159}
     
    266266    double arg = exec->argument(0).toNumber(exec);
    267267    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     268    scope.release();
    268269    double arg2 = exec->argument(1).toNumber(exec);
    269     RETURN_IF_EXCEPTION(scope, encodedJSValue());
    270270
    271271    return JSValue::encode(JSValue(operationMathPow(arg, arg2)));
Note: See TracChangeset for help on using the changeset viewer.