Changeset 225519 in webkit


Ignore:
Timestamp:
Dec 4, 2017 11:51:33 PM (6 years ago)
Author:
jfbastien@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r225507 r225519  
     12017-12-04  JF Bastien  <jfbastien@apple.com>
     2
     3        Math: don't redundantly check for exceptions, just release scope
     4        https://bugs.webkit.org/show_bug.cgi?id=180395
     5
     6        Rubber stamped by Mark Lam.
     7
     8        Two of the exceptions checks could just have been exception scope
     9        releases before the return, which is ever-so-slightly more
     10        efficient. The same technically applies where we have loops over
     11        parameters, but doing the scope release there isn't really more
     12        efficient and is way harder to read.
     13
     14        * runtime/MathObject.cpp:
     15        (JSC::mathProtoFuncATan2):
     16        (JSC::mathProtoFuncPow):
     17
    1182017-12-04  David Quesada  <david_quesada@apple.com>
    219
  • 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.