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/dfg/DFGOperations.cpp

    r172129 r173120  
    138138    NativeCallFrameTracer tracer(&vm, exec);
    139139    if (size < 0) {
    140         vm.throwException(exec, createRangeError(exec, "Requested length is negative"));
     140        vm.throwException(exec, createRangeError(exec, ASCIILiteral("Requested length is negative")));
    141141        return 0;
    142142    }
     
    157157       
    158158        if (buffer->byteLength() % ViewClass::elementSize) {
    159             vm.throwException(exec, createRangeError(exec, "ArrayBuffer length minus the byteOffset is not a multiple of the element size"));
     159            vm.throwException(exec, createRangeError(exec, ASCIILiteral("ArrayBuffer length minus the byteOffset is not a multiple of the element size")));
    160160            return 0;
    161161        }
     
    184184        length = value.asInt32();
    185185    else if (!value.isNumber()) {
    186         vm.throwException(exec, createTypeError(exec, "Invalid array length argument"));
     186        vm.throwException(exec, createTypeError(exec, ASCIILiteral("Invalid array length argument")));
    187187        return 0;
    188188    } else {
    189189        length = static_cast<int>(value.asNumber());
    190190        if (length != value.asNumber()) {
    191             vm.throwException(exec, createTypeError(exec, "Invalid array length argument (fractional lengths not allowed)"));
     191            vm.throwException(exec, createTypeError(exec, ASCIILiteral("Invalid array length argument (fractional lengths not allowed)")));
    192192            return 0;
    193193        }
     
    195195   
    196196    if (length < 0) {
    197         vm.throwException(exec, createRangeError(exec, "Requested length is negative"));
     197        vm.throwException(exec, createRangeError(exec, ASCIILiteral("Requested length is negative")));
    198198        return 0;
    199199    }
Note: See TracChangeset for help on using the changeset viewer.