Ignore:
Timestamp:
Aug 29, 2014, 2:33:30 PM (11 years ago)
Author:
[email protected]
Message:

JavaScriptCore: Use ASCIILiteral where possible
https://bugs.webkit.org/show_bug.cgi?id=136179

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2014-08-29
Reviewed by Michael Saboff.

Source/JavaScriptCore:

General string / character related changes. Use ASCIILiteral where
possible, jsNontrivialString where possible, and replace string
literals with character literals in some places.

No new tests, no changes to functionality.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::nameForRegister):

  • bytecompiler/NodesCodegen.cpp:

(JSC::PostfixNode::emitBytecode):
(JSC::PrefixNode::emitBytecode):
(JSC::AssignErrorNode::emitBytecode):
(JSC::ForInNode::emitMultiLoopBytecode):
(JSC::ForOfNode::emitBytecode):
(JSC::ObjectPatternNode::toString):

  • dfg/DFGFunctionWhitelist.cpp:

(JSC::DFG::FunctionWhitelist::contains):

  • dfg/DFGOperations.cpp:

(JSC::DFG::newTypedArrayWithSize):
(JSC::DFG::newTypedArrayWithOneArgument):

  • inspector/ConsoleMessage.cpp:

(Inspector::ConsoleMessage::addToFrontend):

  • inspector/InspectorBackendDispatcher.cpp:

(Inspector::InspectorBackendDispatcher::dispatch):

  • inspector/ScriptCallStackFactory.cpp:

(Inspector::extractSourceInformationFromException):

  • inspector/scripts/codegen/generator_templates.py:
  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::Frame::functionName):
(JSC::StackVisitor::Frame::sourceURL):

  • jit/JITOperations.cpp:
  • jsc.cpp:

(functionDescribeArray):
(functionRun):
(functionLoad):
(functionReadFile):
(functionCheckSyntax):
(functionTransferArrayBuffer):
(runWithScripts):
(runInteractive):

  • parser/Lexer.cpp:

(JSC::Lexer<T>::invalidCharacterMessage):
(JSC::Lexer<T>::parseString):
(JSC::Lexer<T>::parseStringSlowCase):
(JSC::Lexer<T>::lex):

  • profiler/Profile.cpp:

(JSC::Profile::Profile):

  • runtime/Arguments.cpp:

(JSC::argumentsFuncIterator):

  • runtime/ArrayPrototype.cpp:

(JSC::performSlowSort):
(JSC::arrayProtoFuncSort):

  • runtime/ExceptionHelpers.cpp:

(JSC::createError):
(JSC::createInvalidParameterError):
(JSC::createNotAConstructorError):
(JSC::createNotAFunctionError):
(JSC::createNotAnObjectError):
(JSC::createErrorForInvalidGlobalAssignment):

  • runtime/FunctionPrototype.cpp:

(JSC::insertSemicolonIfNeeded):

  • runtime/JSArray.cpp:

(JSC::JSArray::defineOwnProperty):
(JSC::JSArray::pop):
(JSC::JSArray::push):

  • runtime/JSArrayBufferConstructor.cpp:

(JSC::JSArrayBufferConstructor::finishCreation):

  • runtime/JSArrayBufferPrototype.cpp:

(JSC::arrayBufferProtoFuncSlice):

  • runtime/JSDataView.cpp:

(JSC::JSDataView::create):

  • runtime/JSDataViewPrototype.cpp:

(JSC::getData):
(JSC::setData):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::reset):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::globalFuncProtoSetter):

  • runtime/JSPromiseConstructor.cpp:

(JSC::JSPromiseConstructor::finishCreation):

  • runtime/LiteralParser.cpp:

(JSC::LiteralParser<CharType>::Lexer::lex):
(JSC::LiteralParser<CharType>::Lexer::lexString):
(JSC::LiteralParser<CharType>::parse):

  • runtime/LiteralParser.h:

(JSC::LiteralParser::getErrorMessage):

  • runtime/TypeSet.cpp:

(JSC::TypeSet::seenTypes):
(JSC::TypeSet::displayName):
(JSC::TypeSet::allPrimitiveTypeNames):
(JSC::StructureShape::propertyHash):
(JSC::StructureShape::stringRepresentation):

Source/WTF:

  • wtf/text/WTFString.cpp:

(asciiDebug):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r172820 r173120  
    892892
    893893    return emitThrowReferenceError(generator, m_operator == OpPlusPlus
    894         ? "Postfix ++ operator applied to value that is not a reference."
    895         : "Postfix -- operator applied to value that is not a reference.");
     894        ? ASCIILiteral("Postfix ++ operator applied to value that is not a reference.")
     895        : ASCIILiteral("Postfix -- operator applied to value that is not a reference."));
    896896}
    897897
     
    10751075
    10761076    return emitThrowReferenceError(generator, m_operator == OpPlusPlus
    1077         ? "Prefix ++ operator applied to value that is not a reference."
    1078         : "Prefix -- operator applied to value that is not a reference.");
     1077        ? ASCIILiteral("Prefix ++ operator applied to value that is not a reference.")
     1078        : ASCIILiteral("Prefix -- operator applied to value that is not a reference."));
    10791079}
    10801080
     
    16141614RegisterID* AssignErrorNode::emitBytecode(BytecodeGenerator& generator, RegisterID*)
    16151615{
    1616     return emitThrowReferenceError(generator, "Left side of assignment is not a reference.");
     1616    return emitThrowReferenceError(generator, ASCIILiteral("Left side of assignment is not a reference."));
    16171617}
    16181618
     
    20362036{
    20372037    if (!m_lexpr->isAssignmentLocation()) {
    2038         emitThrowReferenceError(generator, "Left side of for-in statement is not a reference.");
     2038        emitThrowReferenceError(generator, ASCIILiteral("Left side of for-in statement is not a reference."));
    20392039        return;
    20402040    }
     
    21682168{
    21692169    if (!m_lexpr->isAssignmentLocation()) {
    2170         emitThrowReferenceError(generator, "Left side of for-of statement is not a reference.");
     2170        emitThrowReferenceError(generator, ASCIILiteral("Left side of for-of statement is not a reference."));
    21712171        return;
    21722172    }
     
    27852785        } else
    27862786            builder.append(m_targetPatterns[i].propertyName.string());
    2787         builder.append(":");
     2787        builder.append(':');
    27882788        m_targetPatterns[i].pattern->toString(builder);
    27892789        if (i < m_targetPatterns.size() - 1)
Note: See TracChangeset for help on using the changeset viewer.