Ignore:
Timestamp:
Dec 13, 2009, 4:27:07 PM (15 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=32496
Switch remaining cases of string construction to use StringBuilder.
Builds strings using a vector rather than using string append / addition.

Reviewed by Sam Weinig.

(JSC::FunctionExecutable::paramString):

  • runtime/FunctionConstructor.cpp:

(JSC::constructFunction):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::encode):
(JSC::decode):
(JSC::globalFuncEscape):
(JSC::globalFuncUnescape):

  • runtime/JSONObject.cpp:

(JSC::Stringifier::stringify):
(JSC::Stringifier::indent):

  • runtime/JSString.h:
  • runtime/LiteralParser.cpp:

(JSC::LiteralParser::Lexer::lexString):

  • runtime/NumberPrototype.cpp:

(JSC::integerPartNoExp):
(JSC::numberProtoFuncToFixed):
(JSC::numberProtoFuncToPrecision):

  • runtime/Operations.h:

(JSC::jsString):

  • runtime/StringPrototype.cpp:

(JSC::substituteBackreferencesSlow):
(JSC::substituteBackreferences):
(JSC::stringProtoFuncConcat):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Executable.cpp

    r48662 r52075  
    3131#include "JIT.h"
    3232#include "Parser.h"
     33#include "StringBuilder.h"
    3334#include "Vector.h"
    3435
     
    266267{
    267268    FunctionParameters& parameters = *m_parameters;
    268     UString s("");
     269    StringBuilder builder;
    269270    for (size_t pos = 0; pos < parameters.size(); ++pos) {
    270         if (!s.isEmpty())
    271             s += ", ";
    272         s += parameters[pos].ustring();
     271        if (!builder.isEmpty())
     272            builder.append(", ");
     273        builder.append(parameters[pos].ustring());
    273274    }
    274 
    275     return s;
     275    return builder.release();
    276276}
    277277
Note: See TracChangeset for help on using the changeset viewer.