Changeset 173120 in webkit
- Timestamp:
- Aug 29, 2014, 2:33:30 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 31 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/bytecode/CodeBlock.cpp (modified) (1 diff)
-
JavaScriptCore/bytecompiler/NodesCodegen.cpp (modified) (6 diffs)
-
JavaScriptCore/dfg/DFGFunctionWhitelist.cpp (modified) (1 diff)
-
JavaScriptCore/dfg/DFGOperations.cpp (modified) (4 diffs)
-
JavaScriptCore/inspector/ConsoleMessage.cpp (modified) (1 diff)
-
JavaScriptCore/inspector/InspectorBackendDispatcher.cpp (modified) (2 diffs)
-
JavaScriptCore/inspector/ScriptCallStackFactory.cpp (modified) (1 diff)
-
JavaScriptCore/inspector/scripts/codegen/generator_templates.py (modified) (2 diffs, 1 prop)
-
JavaScriptCore/interpreter/StackVisitor.cpp (modified) (3 diffs)
-
JavaScriptCore/jit/JITOperations.cpp (modified) (2 diffs)
-
JavaScriptCore/jsc.cpp (modified) (8 diffs)
-
JavaScriptCore/parser/Lexer.cpp (modified) (14 diffs)
-
JavaScriptCore/profiler/Profile.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/Arguments.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/ArrayPrototype.cpp (modified) (3 diffs)
-
JavaScriptCore/runtime/ExceptionHelpers.cpp (modified) (2 diffs)
-
JavaScriptCore/runtime/FunctionPrototype.cpp (modified) (2 diffs)
-
JavaScriptCore/runtime/JSArray.cpp (modified) (6 diffs)
-
JavaScriptCore/runtime/JSArrayBufferConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/JSArrayBufferPrototype.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/JSDataView.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/JSDataViewPrototype.cpp (modified) (4 diffs)
-
JavaScriptCore/runtime/JSGlobalObject.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/JSPromiseConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/LiteralParser.cpp (modified) (4 diffs)
-
JavaScriptCore/runtime/LiteralParser.h (modified) (1 diff)
-
JavaScriptCore/runtime/TypeSet.cpp (modified) (12 diffs)
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/text/WTFString.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r173113 r173120 1 2014-08-29 Joseph Pecoraro <pecoraro@apple.com> 2 3 JavaScriptCore: Use ASCIILiteral where possible 4 https://bugs.webkit.org/show_bug.cgi?id=136179 5 6 Reviewed by Michael Saboff. 7 8 General string / character related changes. Use ASCIILiteral where 9 possible, jsNontrivialString where possible, and replace string 10 literals with character literals in some places. 11 12 No new tests, no changes to functionality. 13 14 * bytecode/CodeBlock.cpp: 15 (JSC::CodeBlock::nameForRegister): 16 * bytecompiler/NodesCodegen.cpp: 17 (JSC::PostfixNode::emitBytecode): 18 (JSC::PrefixNode::emitBytecode): 19 (JSC::AssignErrorNode::emitBytecode): 20 (JSC::ForInNode::emitMultiLoopBytecode): 21 (JSC::ForOfNode::emitBytecode): 22 (JSC::ObjectPatternNode::toString): 23 * dfg/DFGFunctionWhitelist.cpp: 24 (JSC::DFG::FunctionWhitelist::contains): 25 * dfg/DFGOperations.cpp: 26 (JSC::DFG::newTypedArrayWithSize): 27 (JSC::DFG::newTypedArrayWithOneArgument): 28 * inspector/ConsoleMessage.cpp: 29 (Inspector::ConsoleMessage::addToFrontend): 30 * inspector/InspectorBackendDispatcher.cpp: 31 (Inspector::InspectorBackendDispatcher::dispatch): 32 * inspector/ScriptCallStackFactory.cpp: 33 (Inspector::extractSourceInformationFromException): 34 * inspector/scripts/codegen/generator_templates.py: 35 * interpreter/StackVisitor.cpp: 36 (JSC::StackVisitor::Frame::functionName): 37 (JSC::StackVisitor::Frame::sourceURL): 38 * jit/JITOperations.cpp: 39 * jsc.cpp: 40 (functionDescribeArray): 41 (functionRun): 42 (functionLoad): 43 (functionReadFile): 44 (functionCheckSyntax): 45 (functionTransferArrayBuffer): 46 (runWithScripts): 47 (runInteractive): 48 * parser/Lexer.cpp: 49 (JSC::Lexer<T>::invalidCharacterMessage): 50 (JSC::Lexer<T>::parseString): 51 (JSC::Lexer<T>::parseStringSlowCase): 52 (JSC::Lexer<T>::lex): 53 * profiler/Profile.cpp: 54 (JSC::Profile::Profile): 55 * runtime/Arguments.cpp: 56 (JSC::argumentsFuncIterator): 57 * runtime/ArrayPrototype.cpp: 58 (JSC::performSlowSort): 59 (JSC::arrayProtoFuncSort): 60 * runtime/ExceptionHelpers.cpp: 61 (JSC::createError): 62 (JSC::createInvalidParameterError): 63 (JSC::createNotAConstructorError): 64 (JSC::createNotAFunctionError): 65 (JSC::createNotAnObjectError): 66 (JSC::createErrorForInvalidGlobalAssignment): 67 * runtime/FunctionPrototype.cpp: 68 (JSC::insertSemicolonIfNeeded): 69 * runtime/JSArray.cpp: 70 (JSC::JSArray::defineOwnProperty): 71 (JSC::JSArray::pop): 72 (JSC::JSArray::push): 73 * runtime/JSArrayBufferConstructor.cpp: 74 (JSC::JSArrayBufferConstructor::finishCreation): 75 * runtime/JSArrayBufferPrototype.cpp: 76 (JSC::arrayBufferProtoFuncSlice): 77 * runtime/JSDataView.cpp: 78 (JSC::JSDataView::create): 79 * runtime/JSDataViewPrototype.cpp: 80 (JSC::getData): 81 (JSC::setData): 82 * runtime/JSGlobalObject.cpp: 83 (JSC::JSGlobalObject::reset): 84 * runtime/JSGlobalObjectFunctions.cpp: 85 (JSC::globalFuncProtoSetter): 86 * runtime/JSPromiseConstructor.cpp: 87 (JSC::JSPromiseConstructor::finishCreation): 88 * runtime/LiteralParser.cpp: 89 (JSC::LiteralParser<CharType>::Lexer::lex): 90 (JSC::LiteralParser<CharType>::Lexer::lexString): 91 (JSC::LiteralParser<CharType>::parse): 92 * runtime/LiteralParser.h: 93 (JSC::LiteralParser::getErrorMessage): 94 * runtime/TypeSet.cpp: 95 (JSC::TypeSet::seenTypes): 96 (JSC::TypeSet::displayName): 97 (JSC::TypeSet::allPrimitiveTypeNames): 98 (JSC::StructureShape::propertyHash): 99 (JSC::StructureShape::stringRepresentation): 100 1 101 2014-08-29 Csaba Osztrogonác <ossy@webkit.org> 2 102 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r172950 r173120 3846 3846 } 3847 3847 if (virtualRegister.isArgument()) 3848 return String::format("arguments[%3d]", virtualRegister.toArgument()) .impl();3848 return String::format("arguments[%3d]", virtualRegister.toArgument()); 3849 3849 3850 3850 return ""; -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r172820 r173120 892 892 893 893 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.")); 896 896 } 897 897 … … 1075 1075 1076 1076 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.")); 1079 1079 } 1080 1080 … … 1614 1614 RegisterID* AssignErrorNode::emitBytecode(BytecodeGenerator& generator, RegisterID*) 1615 1615 { 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.")); 1617 1617 } 1618 1618 … … 2036 2036 { 2037 2037 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.")); 2039 2039 return; 2040 2040 } … … 2168 2168 { 2169 2169 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.")); 2171 2171 return; 2172 2172 } … … 2785 2785 } else 2786 2786 builder.append(m_targetPatterns[i].propertyName.string()); 2787 builder.append( ":");2787 builder.append(':'); 2788 2788 m_targetPatterns[i].pattern->toString(builder); 2789 2789 if (i < m_targetPatterns.size() - 1) -
trunk/Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp
r170583 r173120 107 107 return true; 108 108 109 String nameAndHash = name; 110 nameAndHash.append('#'); 111 nameAndHash.append(hash); 112 return m_entries.contains(nameAndHash); 109 return m_entries.contains(name + '#' + hash); 113 110 } 114 111 -
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r172129 r173120 138 138 NativeCallFrameTracer tracer(&vm, exec); 139 139 if (size < 0) { 140 vm.throwException(exec, createRangeError(exec, "Requested length is negative"));140 vm.throwException(exec, createRangeError(exec, ASCIILiteral("Requested length is negative"))); 141 141 return 0; 142 142 } … … 157 157 158 158 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"))); 160 160 return 0; 161 161 } … … 184 184 length = value.asInt32(); 185 185 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"))); 187 187 return 0; 188 188 } else { 189 189 length = static_cast<int>(value.asNumber()); 190 190 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)"))); 192 192 return 0; 193 193 } … … 195 195 196 196 if (length < 0) { 197 vm.throwException(exec, createRangeError(exec, "Requested length is negative"));197 vm.throwException(exec, createRangeError(exec, ASCIILiteral("Requested length is negative"))); 198 198 return 0; 199 199 } -
trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp
r172930 r173120 212 212 } else { 213 213 for (unsigned i = 0; i < m_arguments->argumentCount(); ++i) { 214 RefPtr<Inspector::Protocol::Runtime::RemoteObject> inspectorValue = injectedScript.wrapObject(m_arguments->argumentAt(i), "console", generatePreview);214 RefPtr<Inspector::Protocol::Runtime::RemoteObject> inspectorValue = injectedScript.wrapObject(m_arguments->argumentAt(i), ASCIILiteral("console"), generatePreview); 215 215 if (!inspectorValue) { 216 216 ASSERT_NOT_REACHED(); -
trunk/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
r160523 r173120 91 91 } 92 92 93 RefPtr<InspectorValue> callIdValue = messageObject->get( "id");93 RefPtr<InspectorValue> callIdValue = messageObject->get(ASCIILiteral("id")); 94 94 if (!callIdValue) { 95 95 reportProtocolError(nullptr, InvalidRequest, ASCIILiteral("'id' property was not found")); … … 103 103 } 104 104 105 RefPtr<InspectorValue> methodValue = messageObject->get( "method");105 RefPtr<InspectorValue> methodValue = messageObject->get(ASCIILiteral("method")); 106 106 if (!methodValue) { 107 107 reportProtocolError(&callId, InvalidRequest, ASCIILiteral("'method' property wasn't found")); -
trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp
r164824 r173120 125 125 *columnNumber = columnValue && columnValue.isNumber() ? int(columnValue.toNumber(exec)) : 0; 126 126 JSValue sourceURLValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "sourceURL")); 127 *sourceURL = sourceURLValue && sourceURLValue.isString() ? sourceURLValue.toString(exec)->value(exec) : String("undefined");127 *sourceURL = sourceURLValue && sourceURLValue.isString() ? sourceURLValue.toString(exec)->value(exec) : ASCIILiteral("undefined"); 128 128 exec->clearException(); 129 129 } -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py
-
Property svn:executable
set to
*
r172930 r173120 130 130 ${dispatchCases} 131 131 else 132 m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, String("'") + "${domainName}" + '.' + method + "' was not found");132 m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, makeString('\\'', "${domainName}", '.', method, "' was not found")); 133 133 }""") 134 134 … … 155 155 HashMap<String, CallHandler>::iterator it = dispatchMap.find(method); 156 156 if (it == dispatchMap.end()) { 157 m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, String("'") + "${domainName}" + '.' + method + "' was not found");157 m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, makeString('\\'', "${domainName}", '.', method, "' was not found")); 158 158 return; 159 159 } -
Property svn:executable
set to
-
trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp
r172867 r173120 197 197 switch (codeType()) { 198 198 case CodeType::Eval: 199 traceLine = "eval code";199 traceLine = ASCIILiteral("eval code"); 200 200 break; 201 201 case CodeType::Native: … … 207 207 break; 208 208 case CodeType::Global: 209 traceLine = "global code";209 traceLine = ASCIILiteral("global code"); 210 210 break; 211 211 } … … 227 227 } 228 228 case CodeType::Native: 229 traceLine = "[native code]";229 traceLine = ASCIILiteral("[native code]"); 230 230 break; 231 231 } -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r173082 r173120 970 970 RegExp* regexp = static_cast<RegExp*>(regexpPtr); 971 971 if (!regexp->isValid()) { 972 vm.throwException(exec, createSyntaxError(exec, "Invalid flags supplied to RegExp constructor."));972 vm.throwException(exec, createSyntaxError(exec, ASCIILiteral("Invalid flags supplied to RegExp constructor."))); 973 973 return JSValue::encode(jsUndefined()); 974 974 } … … 1616 1616 JSValue result = jsBoolean(couldDelete); 1617 1617 if (!couldDelete && exec->codeBlock()->isStrictMode()) 1618 vm.throwException(exec, createTypeError(exec, "Unable to delete property."));1618 vm.throwException(exec, createTypeError(exec, ASCIILiteral("Unable to delete property."))); 1619 1619 return JSValue::encode(result); 1620 1620 } -
trunk/Source/JavaScriptCore/jsc.cpp
r173018 r173120 715 715 JSObject* object = jsDynamicCast<JSObject*>(exec->argument(0)); 716 716 if (!object) 717 return JSValue::encode(js String(exec, "<not object>"));718 return JSValue::encode(js String(exec, toString("<Public length: ", object->getArrayLength(), "; vector length: ", object->getVectorLength(), ">")));717 return JSValue::encode(jsNontrivialString(exec, ASCIILiteral("<not object>"))); 718 return JSValue::encode(jsNontrivialString(exec, toString("<Public length: ", object->getArrayLength(), "; vector length: ", object->getVectorLength(), ">"))); 719 719 } 720 720 … … 870 870 Vector<char> script; 871 871 if (!fillBufferWithContentsOfFile(fileName, script)) 872 return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Could not open file.")));872 return JSValue::encode(exec->vm().throwException(exec, createError(exec, ASCIILiteral("Could not open file.")))); 873 873 874 874 GlobalObject* globalObject = GlobalObject::create(exec->vm(), GlobalObject::createStructure(exec->vm(), jsNull()), Vector<String>()); … … 899 899 Vector<char> script; 900 900 if (!fillBufferWithContentsOfFile(fileName, script)) 901 return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Could not open file.")));901 return JSValue::encode(exec->vm().throwException(exec, createError(exec, ASCIILiteral("Could not open file.")))); 902 902 903 903 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); … … 915 915 Vector<char> script; 916 916 if (!fillBufferWithContentsOfFile(fileName, script)) 917 return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Could not open file.")));917 return JSValue::encode(exec->vm().throwException(exec, createError(exec, ASCIILiteral("Could not open file.")))); 918 918 919 919 return JSValue::encode(jsString(exec, stringFromUTF(script.data()))); … … 925 925 Vector<char> script; 926 926 if (!fillBufferWithContentsOfFile(fileName, script)) 927 return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Could not open file.")));927 return JSValue::encode(exec->vm().throwException(exec, createError(exec, ASCIILiteral("Could not open file.")))); 928 928 929 929 JSGlobalObject* globalObject = exec->lexicalGlobalObject(); … … 1012 1012 { 1013 1013 if (exec->argumentCount() < 1) 1014 return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Not enough arguments")));1014 return JSValue::encode(exec->vm().throwException(exec, createError(exec, ASCIILiteral("Not enough arguments")))); 1015 1015 1016 1016 JSArrayBuffer* buffer = jsDynamicCast<JSArrayBuffer*>(exec->argument(0)); 1017 1017 if (!buffer) 1018 return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Expected an array buffer")));1018 return JSValue::encode(exec->vm().throwException(exec, createError(exec, ASCIILiteral("Expected an array buffer")))); 1019 1019 1020 1020 ArrayBufferContents dummyContents; … … 1187 1187 } else { 1188 1188 script = scripts[i].argument; 1189 fileName = "[Command Line]";1189 fileName = ASCIILiteral("[Command Line]"); 1190 1190 } 1191 1191 … … 1229 1229 static void runInteractive(GlobalObject* globalObject) 1230 1230 { 1231 String interpreterName( "Interpreter");1231 String interpreterName(ASCIILiteral("Interpreter")); 1232 1232 1233 1233 bool shouldQuit = false; -
trunk/Source/JavaScriptCore/parser/Lexer.cpp
r172380 r173120 507 507 switch (m_current) { 508 508 case 0: 509 return "Invalid character: '\\0'";509 return ASCIILiteral("Invalid character: '\\0'"); 510 510 case 10: 511 return "Invalid character: '\\n'";511 return ASCIILiteral("Invalid character: '\\n'"); 512 512 case 11: 513 return "Invalid character: '\\v'";513 return ASCIILiteral("Invalid character: '\\v'"); 514 514 case 13: 515 return "Invalid character: '\\r'";515 return ASCIILiteral("Invalid character: '\\r'"); 516 516 case 35: 517 return "Invalid character: '#'";517 return ASCIILiteral("Invalid character: '#'"); 518 518 case 64: 519 return "Invalid character: '@'";519 return ASCIILiteral("Invalid character: '@'"); 520 520 case 96: 521 return "Invalid character: '`'";521 return ASCIILiteral("Invalid character: '`'"); 522 522 default: 523 return String::format("Invalid character '\\u%04u'", static_cast<unsigned>(m_current)) .impl();523 return String::format("Invalid character '\\u%04u'", static_cast<unsigned>(m_current)); 524 524 } 525 525 } … … 1027 1027 shift(); 1028 1028 if (!isASCIIHexDigit(m_current) || !isASCIIHexDigit(peek(1))) { 1029 m_lexErrorMessage = "\\x can only be followed by a hex character sequence";1029 m_lexErrorMessage = ASCIILiteral("\\x can only be followed by a hex character sequence"); 1030 1030 return (atEnd() || (isASCIIHexDigit(m_current) && (m_code + 1 == m_codeEnd))) ? StringUnterminated : StringCannotBeParsed; 1031 1031 } … … 1092 1092 shift(); 1093 1093 if (!isASCIIHexDigit(m_current) || !isASCIIHexDigit(peek(1))) { 1094 m_lexErrorMessage = "\\x can only be followed by a hex character sequence";1094 m_lexErrorMessage = ASCIILiteral("\\x can only be followed by a hex character sequence"); 1095 1095 return StringCannotBeParsed; 1096 1096 } … … 1110 1110 record16('u'); 1111 1111 } else { 1112 m_lexErrorMessage = "\\u can only be followed by a Unicode character sequence";1112 m_lexErrorMessage = ASCIILiteral("\\u can only be followed by a Unicode character sequence"); 1113 1113 return character.valueType() == UnicodeHexValue::IncompleteHex ? StringUnterminated : StringCannotBeParsed; 1114 1114 } … … 1118 1118 shift(); 1119 1119 if (character1 != '0' || isASCIIDigit(m_current)) { 1120 m_lexErrorMessage = "The only valid numeric escape in strict mode is '\\0'";1120 m_lexErrorMessage = ASCIILiteral("The only valid numeric escape in strict mode is '\\0'"); 1121 1121 return StringCannotBeParsed; 1122 1122 } … … 1148 1148 shift(); 1149 1149 } else { 1150 m_lexErrorMessage = "Unterminated string constant";1150 m_lexErrorMessage = ASCIILiteral("Unterminated string constant"); 1151 1151 return StringUnterminated; 1152 1152 } … … 1161 1161 // New-line or end of input is not allowed 1162 1162 if (atEnd() || isLineTerminator(m_current)) { 1163 m_lexErrorMessage = "Unexpected EOF";1163 m_lexErrorMessage = ASCIILiteral("Unexpected EOF"); 1164 1164 return atEnd() ? StringUnterminated : StringCannotBeParsed; 1165 1165 } … … 1523 1523 if (parseMultilineComment()) 1524 1524 goto start; 1525 m_lexErrorMessage = "Multiline comment was not closed properly";1525 m_lexErrorMessage = ASCIILiteral("Multiline comment was not closed properly"); 1526 1526 token = UNTERMINATED_MULTILINE_COMMENT_ERRORTOK; 1527 1527 goto returnError; … … 1649 1649 if ((m_current | 0x20) == 'x') { 1650 1650 if (!isASCIIHexDigit(peek(1))) { 1651 m_lexErrorMessage = "No hexadecimal digits after '0x'";1651 m_lexErrorMessage = ASCIILiteral("No hexadecimal digits after '0x'"); 1652 1652 token = INVALID_HEX_NUMBER_ERRORTOK; 1653 1653 goto returnError; … … 1655 1655 parseHex(tokenData->doubleValue); 1656 1656 if (isIdentStart(m_current)) { 1657 m_lexErrorMessage = "No space between hexadecimal literal and identifier";1657 m_lexErrorMessage = ASCIILiteral("No space between hexadecimal literal and identifier"); 1658 1658 token = INVALID_HEX_NUMBER_ERRORTOK; 1659 1659 goto returnError; … … 1666 1666 record8('0'); 1667 1667 if (strictMode && isASCIIDigit(m_current)) { 1668 m_lexErrorMessage = "Decimal integer literals with a leading zero are forbidden in strict mode";1668 m_lexErrorMessage = ASCIILiteral("Decimal integer literals with a leading zero are forbidden in strict mode"); 1669 1669 token = INVALID_OCTAL_NUMBER_ERRORTOK; 1670 1670 goto returnError; … … 1686 1686 if ((m_current | 0x20) == 'e') { 1687 1687 if (!parseNumberAfterExponentIndicator()) { 1688 m_lexErrorMessage = "Non-number found after exponent indicator";1688 m_lexErrorMessage = ASCIILiteral("Non-number found after exponent indicator"); 1689 1689 token = atEnd() ? UNTERMINATED_NUMERIC_LITERAL_ERRORTOK : INVALID_NUMERIC_LITERAL_ERRORTOK; 1690 1690 goto returnError; … … 1699 1699 // No identifiers allowed directly after numeric literal, e.g. "3in" is bad. 1700 1700 if (UNLIKELY(isIdentStart(m_current))) { 1701 m_lexErrorMessage = "At least one digit must occur after a decimal point";1701 m_lexErrorMessage = ASCIILiteral("At least one digit must occur after a decimal point"); 1702 1702 token = atEnd() ? UNTERMINATED_NUMERIC_LITERAL_ERRORTOK : INVALID_NUMERIC_LITERAL_ERRORTOK; 1703 1703 goto returnError; … … 1750 1750 default: 1751 1751 RELEASE_ASSERT_NOT_REACHED(); 1752 m_lexErrorMessage = "Internal Error";1752 m_lexErrorMessage = ASCIILiteral("Internal Error"); 1753 1753 token = ERRORTOK; 1754 1754 goto returnError; -
trunk/Source/JavaScriptCore/profiler/Profile.cpp
r163140 r173120 44 44 // FIXME: When multi-threading is supported this will be a vector and calls 45 45 // into the profiler will need to know which thread it is executing on. 46 m_head = ProfileNode::create(0, CallIdentifier( "Thread_1", String(), 0, 0), 0, 0);46 m_head = ProfileNode::create(0, CallIdentifier(ASCIILiteral("Thread_1"), String(), 0, 0), 0, 0); 47 47 } 48 48 -
trunk/Source/JavaScriptCore/runtime/Arguments.cpp
r172176 r173120 436 436 Arguments* arguments = jsDynamicCast<Arguments*>(thisObj); 437 437 if (!arguments) 438 return JSValue::encode(throwTypeError(exec, "Attempted to use Arguments iterator on non-Arguments object"));438 return JSValue::encode(throwTypeError(exec, ASCIILiteral("Attempted to use Arguments iterator on non-Arguments object"))); 439 439 return JSValue::encode(JSArgumentsIterator::create(exec->vm(), exec->callee()->globalObject()->argumentsIteratorStructure(), arguments)); 440 440 } -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r172756 r173120 695 695 return false; 696 696 } else if (!thisObj->methodTable(exec->vm())->deletePropertyByIndex(thisObj, exec, i)) { 697 throwTypeError(exec, "Unable to delete property.");697 throwTypeError(exec, ASCIILiteral("Unable to delete property.")); 698 698 return false; 699 699 } … … 703 703 return false; 704 704 } else if (!thisObj->methodTable(exec->vm())->deletePropertyByIndex(thisObj, exec, themin)) { 705 throwTypeError(exec, "Unable to delete property.");705 throwTypeError(exec, ASCIILiteral("Unable to delete property.")); 706 706 return false; 707 707 } … … 768 768 769 769 if (!thisObj->methodTable(exec->vm())->deletePropertyByIndex(thisObj, exec, index)) { 770 throwTypeError(exec, "Unable to delete property.");770 throwTypeError(exec, ASCIILiteral("Unable to delete property.")); 771 771 return JSValue::encode(jsUndefined()); 772 772 } -
trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
r171824 r173120 123 123 JSObject* createError(ExecState* exec, ErrorFactory errorFactory, JSValue value, const String& message) 124 124 { 125 String errorMessage = makeString(errorDescriptionForValue(exec, value)->value(exec), " ", message);125 String errorMessage = makeString(errorDescriptionForValue(exec, value)->value(exec), ' ', message); 126 126 JSObject* exception = errorFactory(exec, errorMessage); 127 127 ASSERT(exception->isErrorInstance()); … … 132 132 JSObject* createInvalidParameterError(ExecState* exec, const char* op, JSValue value) 133 133 { 134 return createError(exec, createTypeError, value, makeString("is not a valid argument for '", op, "'"));134 return createError(exec, createTypeError, value, makeString("is not a valid argument for '", op, '\'')); 135 135 } 136 136 137 137 JSObject* createNotAConstructorError(ExecState* exec, JSValue value) 138 138 { 139 return createError(exec, createTypeError, value, "is not a constructor");139 return createError(exec, createTypeError, value, ASCIILiteral("is not a constructor")); 140 140 } 141 141 142 142 JSObject* createNotAFunctionError(ExecState* exec, JSValue value) 143 143 { 144 return createError(exec, createTypeError, value, "is not a function");144 return createError(exec, createTypeError, value, ASCIILiteral("is not a function")); 145 145 } 146 146 147 147 JSObject* createNotAnObjectError(ExecState* exec, JSValue value) 148 148 { 149 return createError(exec, createTypeError, value, "is not an object");149 return createError(exec, createTypeError, value, ASCIILiteral("is not an object")); 150 150 } 151 151 152 152 JSObject* createErrorForInvalidGlobalAssignment(ExecState* exec, const String& propertyName) 153 153 { 154 return createReferenceError(exec, makeString("Strict mode forbids implicit creation of global property '", propertyName, "'"));154 return createReferenceError(exec, makeString("Strict mode forbids implicit creation of global property '", propertyName, '\'')); 155 155 } 156 156 -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r171824 r173120 86 86 { 87 87 if (!bodyIncludesBraces) 88 functionBody = makeString("{ ", functionBody, "}");88 functionBody = makeString("{ ", functionBody, '}'); 89 89 90 90 ASSERT(functionBody[0] == '{'); … … 95 95 if (!Lexer<UChar>::isWhiteSpace(ch) && !Lexer<UChar>::isLineTerminator(ch)) { 96 96 if (ch != ';' && ch != '}') 97 functionBody = makeString(functionBody.substringSharingImpl(0, i + 1), ";", functionBody.substringSharingImpl(i + 1, functionBody.length() - (i + 1)));97 functionBody = makeString(functionBody.substringSharingImpl(0, i + 1), ';', functionBody.substringSharingImpl(i + 1, functionBody.length() - (i + 1))); 98 98 return; 99 99 } -
trunk/Source/JavaScriptCore/runtime/JSArray.cpp
r172176 r173120 109 109 // d. If newLen is not equal to ToNumber( Desc.[[Value]]), throw a RangeError exception. 110 110 if (newLen != descriptor.value().toNumber(exec)) { 111 exec->vm().throwException(exec, createRangeError(exec, "Invalid array length"));111 exec->vm().throwException(exec, createRangeError(exec, ASCIILiteral("Invalid array length"))); 112 112 return false; 113 113 } … … 524 524 // Call the [[Delete]] internal method of O with arguments indx and true. 525 525 if (!deletePropertyByIndex(this, exec, index)) { 526 throwTypeError(exec, "Unable to delete property.");526 throwTypeError(exec, ASCIILiteral("Unable to delete property.")); 527 527 return jsUndefined(); 528 528 } … … 568 568 methodTable(exec->vm())->putByIndex(this, exec, length, value, true); 569 569 if (!exec->hadException()) 570 exec->vm().throwException(exec, createRangeError(exec, "Invalid array length"));570 exec->vm().throwException(exec, createRangeError(exec, ASCIILiteral("Invalid array length"))); 571 571 return; 572 572 } … … 588 588 methodTable(exec->vm())->putByIndex(this, exec, length, value, true); 589 589 if (!exec->hadException()) 590 exec->vm().throwException(exec, createRangeError(exec, "Invalid array length"));590 exec->vm().throwException(exec, createRangeError(exec, ASCIILiteral("Invalid array length"))); 591 591 return; 592 592 } … … 620 620 methodTable(exec->vm())->putByIndex(this, exec, length, value, true); 621 621 if (!exec->hadException()) 622 exec->vm().throwException(exec, createRangeError(exec, "Invalid array length"));622 exec->vm().throwException(exec, createRangeError(exec, ASCIILiteral("Invalid array length"))); 623 623 return; 624 624 } … … 655 655 // Per ES5.1 15.4.4.7 step 6 & 15.4.5.1 step 3.d. 656 656 if (!exec->hadException()) 657 exec->vm().throwException(exec, createRangeError(exec, "Invalid array length"));657 exec->vm().throwException(exec, createRangeError(exec, ASCIILiteral("Invalid array length"))); 658 658 return; 659 659 } -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp
r171824 r173120 50 50 void JSArrayBufferConstructor::finishCreation(VM& vm, JSArrayBufferPrototype* prototype) 51 51 { 52 Base::finishCreation(vm, "ArrayBuffer");52 Base::finishCreation(vm, ASCIILiteral("ArrayBuffer")); 53 53 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); 54 54 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontEnum | DontDelete | ReadOnly); -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp
r171824 r173120 42 42 JSArrayBuffer* thisObject = jsDynamicCast<JSArrayBuffer*>(exec->thisValue()); 43 43 if (!thisObject) 44 return throwVMError(exec, createTypeError(exec, "Receiver of slice must be an array buffer."));44 return throwVMError(exec, createTypeError(exec, ASCIILiteral("Receiver of slice must be an array buffer."))); 45 45 46 46 if (!exec->argumentCount()) 47 return throwVMError(exec, createTypeError(exec, "Slice requires at least one argument."));47 return throwVMError(exec, createTypeError(exec, ASCIILiteral("Slice requires at least one argument."))); 48 48 49 49 int32_t begin = exec->argument(0).toInt32(exec); -
trunk/Source/JavaScriptCore/runtime/JSDataView.cpp
r171824 r173120 49 49 RefPtr<ArrayBuffer> buffer = passedBuffer; 50 50 if (!ArrayBufferView::verifySubRangeLength(buffer, byteOffset, byteLength, sizeof(uint8_t))) { 51 throwVMError(exec, createRangeError(exec, "Length out of range of buffer"));51 throwVMError(exec, createRangeError(exec, ASCIILiteral("Length out of range of buffer"))); 52 52 return nullptr; 53 53 } 54 54 if (!ArrayBufferView::verifyByteOffsetAlignment(byteOffset, sizeof(uint8_t))) { 55 exec->vm().throwException(exec, createRangeError(exec, "Byte offset is not aligned"));55 exec->vm().throwException(exec, createRangeError(exec, ASCIILiteral("Byte offset is not aligned"))); 56 56 return nullptr; 57 57 } -
trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp
r172793 r173120 120 120 JSDataView* dataView = jsDynamicCast<JSDataView*>(exec->thisValue()); 121 121 if (!dataView) 122 return throwVMError(exec, createTypeError(exec, "Receiver of DataView method must be a DataView"));122 return throwVMError(exec, createTypeError(exec, ASCIILiteral("Receiver of DataView method must be a DataView"))); 123 123 124 124 if (!exec->argumentCount()) 125 return throwVMError(exec, createTypeError(exec, "Need at least one argument (the byteOffset)"));125 return throwVMError(exec, createTypeError(exec, ASCIILiteral("Need at least one argument (the byteOffset)"))); 126 126 127 127 unsigned byteOffset = exec->uncheckedArgument(0).toUInt32(exec); … … 139 139 unsigned byteLength = dataView->length(); 140 140 if (elementSize > byteLength || byteOffset > byteLength - elementSize) 141 return throwVMError(exec, createRangeError(exec, "Out of bounds access"));141 return throwVMError(exec, createRangeError(exec, ASCIILiteral("Out of bounds access"))); 142 142 143 143 const unsigned dataSize = sizeof(typename Adaptor::Type); … … 165 165 JSDataView* dataView = jsDynamicCast<JSDataView*>(exec->thisValue()); 166 166 if (!dataView) 167 return throwVMError(exec, createTypeError(exec, "Receiver of DataView method must be a DataView"));167 return throwVMError(exec, createTypeError(exec, ASCIILiteral("Receiver of DataView method must be a DataView"))); 168 168 169 169 if (exec->argumentCount() < 2) 170 return throwVMError(exec, createTypeError(exec, "Need at least two argument (the byteOffset and value)"));170 return throwVMError(exec, createTypeError(exec, ASCIILiteral("Need at least two argument (the byteOffset and value)"))); 171 171 172 172 unsigned byteOffset = exec->uncheckedArgument(0).toUInt32(exec); … … 194 194 unsigned byteLength = dataView->length(); 195 195 if (elementSize > byteLength || byteOffset > byteLength - elementSize) 196 return throwVMError(exec, createRangeError(exec, "Out of bounds access"));196 return throwVMError(exec, createRangeError(exec, ASCIILiteral("Out of bounds access"))); 197 197 198 198 uint8_t* dataPtr = static_cast<uint8_t*>(dataView->vector()) + byteOffset; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r173100 r173120 441 441 442 442 std::array<InternalFunction*, NUMBER_OF_TYPED_ARRAY_TYPES> typedArrayConstructors; 443 typedArrayConstructors[toIndex(TypeInt8)] = JSInt8ArrayConstructor::create(vm, JSInt8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt8)].prototype.get(), "Int8Array");444 typedArrayConstructors[toIndex(TypeInt16)] = JSInt16ArrayConstructor::create(vm, JSInt16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt16)].prototype.get(), "Int16Array");445 typedArrayConstructors[toIndex(TypeInt32)] = JSInt32ArrayConstructor::create(vm, JSInt32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt32)].prototype.get(), "Int32Array");446 typedArrayConstructors[toIndex(TypeUint8)] = JSUint8ArrayConstructor::create(vm, JSUint8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8)].prototype.get(), "Uint8Array");447 typedArrayConstructors[toIndex(TypeUint8Clamped)] = JSUint8ClampedArrayConstructor::create(vm, JSUint8ClampedArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8Clamped)].prototype.get(), "Uint8ClampedArray");448 typedArrayConstructors[toIndex(TypeUint16)] = JSUint16ArrayConstructor::create(vm, JSUint16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint16)].prototype.get(), "Uint16Array");449 typedArrayConstructors[toIndex(TypeUint32)] = JSUint32ArrayConstructor::create(vm, JSUint32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint32)].prototype.get(), "Uint32Array");450 typedArrayConstructors[toIndex(TypeFloat32)] = JSFloat32ArrayConstructor::create(vm, JSFloat32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat32)].prototype.get(), "Float32Array");451 typedArrayConstructors[toIndex(TypeFloat64)] = JSFloat64ArrayConstructor::create(vm, JSFloat64ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat64)].prototype.get(), "Float64Array");452 typedArrayConstructors[toIndex(TypeDataView)] = JSDataViewConstructor::create(vm, JSDataViewConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeDataView)].prototype.get(), "DataView");443 typedArrayConstructors[toIndex(TypeInt8)] = JSInt8ArrayConstructor::create(vm, JSInt8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt8)].prototype.get(), ASCIILiteral("Int8Array")); 444 typedArrayConstructors[toIndex(TypeInt16)] = JSInt16ArrayConstructor::create(vm, JSInt16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt16)].prototype.get(), ASCIILiteral("Int16Array")); 445 typedArrayConstructors[toIndex(TypeInt32)] = JSInt32ArrayConstructor::create(vm, JSInt32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt32)].prototype.get(), ASCIILiteral("Int32Array")); 446 typedArrayConstructors[toIndex(TypeUint8)] = JSUint8ArrayConstructor::create(vm, JSUint8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8)].prototype.get(), ASCIILiteral("Uint8Array")); 447 typedArrayConstructors[toIndex(TypeUint8Clamped)] = JSUint8ClampedArrayConstructor::create(vm, JSUint8ClampedArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8Clamped)].prototype.get(), ASCIILiteral("Uint8ClampedArray")); 448 typedArrayConstructors[toIndex(TypeUint16)] = JSUint16ArrayConstructor::create(vm, JSUint16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint16)].prototype.get(), ASCIILiteral("Uint16Array")); 449 typedArrayConstructors[toIndex(TypeUint32)] = JSUint32ArrayConstructor::create(vm, JSUint32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint32)].prototype.get(), ASCIILiteral("Uint32Array")); 450 typedArrayConstructors[toIndex(TypeFloat32)] = JSFloat32ArrayConstructor::create(vm, JSFloat32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat32)].prototype.get(), ASCIILiteral("Float32Array")); 451 typedArrayConstructors[toIndex(TypeFloat64)] = JSFloat64ArrayConstructor::create(vm, JSFloat64ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat64)].prototype.get(), ASCIILiteral("Float64Array")); 452 typedArrayConstructors[toIndex(TypeDataView)] = JSDataViewConstructor::create(vm, JSDataViewConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeDataView)].prototype.get(), ASCIILiteral("DataView")); 453 453 454 454 for (unsigned typedArrayIndex = NUMBER_OF_TYPED_ARRAY_TYPES; typedArrayIndex--;) { -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r167394 r173120 803 803 804 804 if (!thisObject->setPrototypeWithCycleCheck(exec, value)) 805 exec->vm().throwException(exec, createError(exec, "cyclic __proto__ value"));805 exec->vm().throwException(exec, createError(exec, ASCIILiteral("cyclic __proto__ value"))); 806 806 return JSValue::encode(jsUndefined()); 807 807 } -
trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp
r171824 r173120 86 86 void JSPromiseConstructor::finishCreation(VM& vm, JSPromisePrototype* promisePrototype) 87 87 { 88 Base::finishCreation(vm, "Promise");88 Base::finishCreation(vm, ASCIILiteral("Promise")); 89 89 putDirectWithoutTransition(vm, vm.propertyNames->prototype, promisePrototype, DontEnum | DontDelete | ReadOnly); 90 90 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete); -
trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp
r163844 r173120 282 282 } 283 283 } 284 m_lexErrorMessage = String::format("Unrecognized token '%c'", *m_ptr) .impl();284 m_lexErrorMessage = String::format("Unrecognized token '%c'", *m_ptr); 285 285 return TokError; 286 286 } … … 407 407 for (int i = 1; i < 5; i++) { 408 408 if (!isASCIIHexDigit(m_ptr[i])) { 409 m_lexErrorMessage = String::format("\"\\%s\" is not a valid unicode escape", String(m_ptr, 5).ascii().data()) .impl();409 m_lexErrorMessage = String::format("\"\\%s\" is not a valid unicode escape", String(m_ptr, 5).ascii().data()); 410 410 return TokError; 411 411 } … … 421 421 break; 422 422 } 423 m_lexErrorMessage = String::format("Invalid escape character %c", *m_ptr) .impl();423 m_lexErrorMessage = String::format("Invalid escape character %c", *m_ptr); 424 424 return TokError; 425 425 } … … 712 712 const LiteralParserToken<CharType>& token = m_lexer.currentToken(); 713 713 if (token.stringIs8Bit) 714 m_parseErrorMessage = String::format("Unexpected identifier \"%s\"", String(m_lexer.currentToken().stringToken8, m_lexer.currentToken().stringLength).ascii().data()) .impl();714 m_parseErrorMessage = String::format("Unexpected identifier \"%s\"", String(m_lexer.currentToken().stringToken8, m_lexer.currentToken().stringLength).ascii().data()); 715 715 else 716 m_parseErrorMessage = String::format("Unexpected identifier \"%s\"", String(m_lexer.currentToken().stringToken16, m_lexer.currentToken().stringLength).ascii().data()) .impl();716 m_parseErrorMessage = String::format("Unexpected identifier \"%s\"", String(m_lexer.currentToken().stringToken16, m_lexer.currentToken().stringLength).ascii().data()); 717 717 return JSValue(); 718 718 } -
trunk/Source/JavaScriptCore/runtime/LiteralParser.h
r160344 r173120 99 99 { 100 100 if (!m_lexer.getErrorMessage().isEmpty()) 101 return String::format("JSON Parse error: %s", m_lexer.getErrorMessage().ascii().data()) .impl();101 return String::format("JSON Parse error: %s", m_lexer.getErrorMessage().ascii().data()); 102 102 if (!m_parseErrorMessage.isEmpty()) 103 return String::format("JSON Parse error: %s", m_parseErrorMessage.ascii().data()) .impl();103 return String::format("JSON Parse error: %s", m_parseErrorMessage.ascii().data()); 104 104 return ASCIILiteral("JSON Parse error: Unable to parse JSON string"); 105 105 } -
trunk/Source/JavaScriptCore/runtime/TypeSet.cpp
r172976 r173120 100 100 { 101 101 if (m_seenTypes == TypeNothing) 102 return "(Unreached Statement)";102 return ASCIILiteral("(Unreached Statement)"); 103 103 104 104 StringBuilder seen; … … 124 124 RefPtr<StructureShape> shape = m_structureHistory.at(i); 125 125 seen.append(shape->m_constructorName); 126 seen.append( " ");126 seen.append(' '); 127 127 } 128 128 … … 131 131 for (size_t i = 0; i < m_structureHistory.size(); i++) { 132 132 seen.append(m_structureHistory.at(i)->stringRepresentation()); 133 seen.append( " ");133 seen.append(' '); 134 134 } 135 135 if (m_structureHistory.size()) 136 seen.append( "]");136 seen.append(']'); 137 137 138 138 if (m_structureHistory.size()) { … … 167 167 { 168 168 if (m_seenTypes == TypeNothing) 169 return "";169 return emptyString(); 170 170 171 171 if (m_structureHistory.size() && doesTypeConformTo(TypeObject | TypeNull | TypeUndefined)) { … … 174 174 if (doesTypeConformTo(TypeObject)) 175 175 return ctorName; 176 elseif (doesTypeConformTo(TypeObject | TypeNull | TypeUndefined))177 return ctorName + "?";176 if (doesTypeConformTo(TypeObject | TypeNull | TypeUndefined)) 177 return ctorName + '?'; 178 178 } 179 179 … … 182 182 183 183 if (doesTypeConformTo(TypeFunction)) 184 return "Function";184 return ASCIILiteral("Function"); 185 185 if (doesTypeConformTo(TypeUndefined)) 186 return "Undefined";186 return ASCIILiteral("Undefined"); 187 187 if (doesTypeConformTo(TypeNull)) 188 return "Null";188 return ASCIILiteral("Null"); 189 189 if (doesTypeConformTo(TypeBoolean)) 190 return "Boolean";190 return ASCIILiteral("Boolean"); 191 191 if (doesTypeConformTo(TypeMachineInt)) 192 return "Integer";192 return ASCIILiteral("Integer"); 193 193 if (doesTypeConformTo(TypeNumber | TypeMachineInt)) 194 return "Number";194 return ASCIILiteral("Number"); 195 195 if (doesTypeConformTo(TypeString)) 196 return "String";196 return ASCIILiteral("String"); 197 197 198 198 if (doesTypeConformTo(TypeNull | TypeUndefined)) 199 return "(?)";199 return ASCIILiteral("(?)"); 200 200 201 201 if (doesTypeConformTo(TypeFunction | TypeNull | TypeUndefined)) 202 return "Function?";202 return ASCIILiteral("Function?"); 203 203 if (doesTypeConformTo(TypeBoolean | TypeNull | TypeUndefined)) 204 return "Boolean?";204 return ASCIILiteral("Boolean?"); 205 205 if (doesTypeConformTo(TypeMachineInt | TypeNull | TypeUndefined)) 206 return "Integer?";206 return ASCIILiteral("Integer?"); 207 207 if (doesTypeConformTo(TypeNumber | TypeMachineInt | TypeNull | TypeUndefined)) 208 return "Number?";208 return ASCIILiteral("Number?"); 209 209 if (doesTypeConformTo(TypeString | TypeNull | TypeUndefined)) 210 return "String?";210 return ASCIILiteral("String?"); 211 211 212 212 if (doesTypeConformTo(TypeObject | TypeFunction | TypeString)) 213 return "Object";213 return ASCIILiteral("Object"); 214 214 if (doesTypeConformTo(TypeObject | TypeFunction | TypeString | TypeNull | TypeUndefined)) 215 return "Object?";216 217 return "(many)";215 return ASCIILiteral("Object?"); 216 217 return ASCIILiteral("(many)"); 218 218 } 219 219 … … 222 222 RefPtr<Inspector::Protocol::Array<String>> seen = Inspector::Protocol::Array<String>::create(); 223 223 if (m_seenTypes & TypeUndefined) 224 seen->addItem("Undefined");224 seen->addItem(ASCIILiteral("Undefined")); 225 225 if (m_seenTypes & TypeNull) 226 seen->addItem("Null");226 seen->addItem(ASCIILiteral("Null")); 227 227 if (m_seenTypes & TypeBoolean) 228 seen->addItem("Boolean");228 seen->addItem(ASCIILiteral("Boolean")); 229 229 if (m_seenTypes & TypeMachineInt) 230 seen->addItem("Integer");230 seen->addItem(ASCIILiteral("Integer")); 231 231 if (m_seenTypes & TypeNumber) 232 seen->addItem("Number");232 seen->addItem(ASCIILiteral("Number")); 233 233 if (m_seenTypes & TypeString) 234 seen->addItem("String");234 seen->addItem(ASCIILiteral("String")); 235 235 236 236 return seen.release(); … … 283 283 284 284 StringBuilder builder; 285 builder.append( ":");285 builder.append(':'); 286 286 builder.append(m_constructorName); 287 builder.append( ":");287 builder.append(':'); 288 288 289 289 for (auto iter = m_fields.begin(), end = m_fields.end(); iter != end; ++iter) { … … 294 294 295 295 if (m_proto) { 296 builder.append( ":");296 builder.append(':'); 297 297 builder.append("__proto__"); 298 298 builder.append(m_proto->propertyHash()); … … 340 340 RefPtr<StructureShape> curShape = this; 341 341 342 representation.append( "{");342 representation.append('{'); 343 343 while (curShape) { 344 344 for (auto it = curShape->m_fields.begin(), end = curShape->m_fields.end(); it != end; ++it) { … … 349 349 350 350 if (curShape->m_proto) { 351 String prot = String("__proto__") + String(" [") + curShape->m_proto->m_constructorName + String("]");351 String prot = makeString("__proto__ [", curShape->m_proto->m_constructorName, ']'); 352 352 representation.append(prot); 353 353 representation.append(", "); … … 360 360 representation.resize(representation.length() - 2); 361 361 362 representation.append( "}");362 representation.append('}'); 363 363 364 364 return representation.toString(); -
trunk/Source/WTF/ChangeLog
r173072 r173120 1 2014-08-29 Joseph Pecoraro <pecoraro@apple.com> 2 3 JavaScriptCore: Use ASCIILiteral where possible 4 https://bugs.webkit.org/show_bug.cgi?id=136179 5 6 Reviewed by Michael Saboff. 7 8 * wtf/text/WTFString.cpp: 9 (asciiDebug): 10 1 11 2014-08-27 Filip Pizlo <fpizlo@apple.com> 2 12 -
trunk/Source/WTF/wtf/text/WTFString.cpp
r170774 r173120 1207 1207 { 1208 1208 if (!impl) 1209 return asciiDebug(String( "[null]").impl());1209 return asciiDebug(String(ASCIILiteral("[null]")).impl()); 1210 1210 1211 1211 Vector<char> buffer;
Note:
See TracChangeset
for help on using the changeset viewer.