Changeset 207851 in webkit


Ignore:
Timestamp:
Oct 25, 2016 3:30:08 PM (8 years ago)
Author:
mark.lam@apple.com
Message:

Add ThrowScope::release() calls at all call sites of jsMakeNontrivialString().
https://bugs.webkit.org/show_bug.cgi?id=163990

Reviewed by Geoffrey Garen.

  • runtime/ArrayPrototype.cpp:

(JSC::arrayProtoFuncToString):

  • runtime/ErrorPrototype.cpp:

(JSC::errorProtoFuncToString):

  • runtime/FunctionPrototype.cpp:

(JSC::functionProtoFuncToString):

  • runtime/RegExpPrototype.cpp:

(JSC::regExpProtoFuncToString):

  • runtime/StringPrototype.cpp:

(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):

Location:
trunk/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r207849 r207851  
     12016-10-25  Mark Lam  <mark.lam@apple.com>
     2
     3        Add ThrowScope::release() calls at all call sites of jsMakeNontrivialString().
     4        https://bugs.webkit.org/show_bug.cgi?id=163990
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * runtime/ArrayPrototype.cpp:
     9        (JSC::arrayProtoFuncToString):
     10        * runtime/ErrorPrototype.cpp:
     11        (JSC::errorProtoFuncToString):
     12        * runtime/FunctionPrototype.cpp:
     13        (JSC::functionProtoFuncToString):
     14        * runtime/RegExpPrototype.cpp:
     15        (JSC::regExpProtoFuncToString):
     16        * runtime/StringPrototype.cpp:
     17        (JSC::stringProtoFuncBig):
     18        (JSC::stringProtoFuncSmall):
     19        (JSC::stringProtoFuncBlink):
     20        (JSC::stringProtoFuncBold):
     21        (JSC::stringProtoFuncFixed):
     22        (JSC::stringProtoFuncItalics):
     23        (JSC::stringProtoFuncStrike):
     24        (JSC::stringProtoFuncSub):
     25        (JSC::stringProtoFuncSup):
     26        (JSC::stringProtoFuncFontcolor):
     27        (JSC::stringProtoFuncFontsize):
     28        (JSC::stringProtoFuncAnchor):
     29
    1302016-10-25  Mark Lam  <mark.lam@apple.com>
    231
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r207411 r207851  
    373373        customJoinCase = true;
    374374
    375     if (UNLIKELY(customJoinCase))
     375    if (UNLIKELY(customJoinCase)) {
     376        scope.release();
    376377        return JSValue::encode(jsMakeNontrivialString(exec, "[object ", thisObject->methodTable(vm)->className(thisObject), "]"));
     378    }
    377379
    378380    // 4. Return the result of calling the [[Call]] internal method of func providing array as the this value and an empty arguments list.
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp

    r206386 r207851  
    121121
    122122    // 10. Return the result of concatenating name, ":", a single space character, and msg.
     123    scope.release();
    123124    return JSValue::encode(jsMakeNontrivialString(exec, nameString, ": ", messageString));
    124125}
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp

    r206267 r207851  
    9595    if (thisValue.inherits(JSFunction::info())) {
    9696        JSFunction* function = jsCast<JSFunction*>(thisValue);
    97         if (function->isHostOrBuiltinFunction())
     97        if (function->isHostOrBuiltinFunction()) {
     98            scope.release();
    9899            return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(vm), "() {\n    [native code]\n}"));
     100        }
    99101
    100102        FunctionExecutable* executable = function->jsExecutable();
     
    109111            executable->parametersStartOffset(),
    110112            executable->parametersStartOffset() + executable->source().length());
     113        scope.release();
    111114        return JSValue::encode(jsMakeNontrivialString(exec, functionHeader, function->name(vm), source));
    112115    }
     
    114117    if (thisValue.inherits(InternalFunction::info())) {
    115118        InternalFunction* function = asInternalFunction(thisValue);
     119        scope.release();
    116120        return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(), "() {\n    [native code]\n}"));
    117121    }
     
    122126            CallData callData;
    123127            if (object->methodTable(vm)->getCallData(object, callData) != CallType::None) {
    124                 if (auto* classInfo = object->classInfo())
     128                if (auto* classInfo = object->classInfo()) {
     129                    scope.release();
    125130                    return JSValue::encode(jsMakeNontrivialString(exec, "function ", classInfo->className, "() {\n    [native code]\n}"));
     131                }
    126132            }
    127133        }
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp

    r207334 r207851  
    242242    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    243243
     244    scope.release();
    244245    return JSValue::encode(jsMakeNontrivialString(exec, '/', source, '/', flags));
    245246}
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r207652 r207851  
    14981498    String s = thisValue.toString(exec)->value(exec);
    14991499    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     1500    scope.release();
    15001501    return JSValue::encode(jsMakeNontrivialString(exec, "<big>", s, "</big>"));
    15011502}
     
    15111512    String s = thisValue.toString(exec)->value(exec);
    15121513    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     1514    scope.release();
    15131515    return JSValue::encode(jsMakeNontrivialString(exec, "<small>", s, "</small>"));
    15141516}
     
    15241526    String s = thisValue.toString(exec)->value(exec);
    15251527    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     1528    scope.release();
    15261529    return JSValue::encode(jsMakeNontrivialString(exec, "<blink>", s, "</blink>"));
    15271530}
     
    15371540    String s = thisValue.toString(exec)->value(exec);
    15381541    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     1542    scope.release();
    15391543    return JSValue::encode(jsMakeNontrivialString(exec, "<b>", s, "</b>"));
    15401544}
     
    15501554    String s = thisValue.toString(exec)->value(exec);
    15511555    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     1556    scope.release();
    15521557    return JSValue::encode(jsMakeNontrivialString(exec, "<tt>", s, "</tt>"));
    15531558}
     
    15631568    String s = thisValue.toString(exec)->value(exec);
    15641569    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     1570    scope.release();
    15651571    return JSValue::encode(jsMakeNontrivialString(exec, "<i>", s, "</i>"));
    15661572}
     
    15761582    String s = thisValue.toString(exec)->value(exec);
    15771583    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     1584    scope.release();
    15781585    return JSValue::encode(jsMakeNontrivialString(exec, "<strike>", s, "</strike>"));
    15791586}
     
    15891596    String s = thisValue.toString(exec)->value(exec);
    15901597    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     1598    scope.release();
    15911599    return JSValue::encode(jsMakeNontrivialString(exec, "<sub>", s, "</sub>"));
    15921600}
     
    16021610    String s = thisValue.toString(exec)->value(exec);
    16031611    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     1612    scope.release();
    16041613    return JSValue::encode(jsMakeNontrivialString(exec, "<sup>", s, "</sup>"));
    16051614}
     
    16201629    color.replaceWithLiteral('"', "&quot;");
    16211630
     1631    scope.release();
    16221632    return JSValue::encode(jsMakeNontrivialString(exec, "<font color=\"", color, "\">", s, "</font>"));
    16231633}
     
    16741684    fontSize.replaceWithLiteral('"', "&quot;");
    16751685
     1686    scope.release();
    16761687    return JSValue::encode(jsMakeNontrivialString(exec, "<font size=\"", fontSize, "\">", s, "</font>"));
    16771688}
     
    16921703    anchor.replaceWithLiteral('"', "&quot;");
    16931704
     1705    scope.release();
    16941706    return JSValue::encode(jsMakeNontrivialString(exec, "<a name=\"", anchor, "\">", s, "</a>"));
    16951707}
Note: See TracChangeset for help on using the changeset viewer.