Changeset 52028 in webkit for trunk/JavaScriptCore/bytecode
- Timestamp:
- Dec 11, 2009, 3:34:10 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r51735 r52028 52 52 int pos = 0; 53 53 while ((pos = result.find('\"', pos)) >= 0) { 54 result = result.substr(0, pos) + "\"\\\"\"" + result.substr(pos + 1);54 result = makeString(result.substr(0, pos), "\"\\\"\"", result.substr(pos + 1)); 55 55 pos += 4; 56 56 } … … 63 63 return "0"; 64 64 65 if (val.isString()) { 66 UString result("\""); 67 result += escapeQuotes(val.toString(exec)) + "\""; 68 return result; 69 } 65 if (val.isString()) 66 return makeString("\"", escapeQuotes(val.toString(exec)), "\""); 70 67 71 68 return val.toString(exec); … … 74 71 static CString constantName(ExecState* exec, int k, JSValue value) 75 72 { 76 return (valueToSourceString(exec, value) + "(@k" + UString::from(k - FirstConstantRegisterIndex) +")").UTF8String();73 return makeString(valueToSourceString(exec, value), "(@k", UString::from(k - FirstConstantRegisterIndex), ")").UTF8String(); 77 74 } 78 75 79 76 static CString idName(int id0, const Identifier& ident) 80 77 { 81 return (ident.ustring() + "(@id" + UString::from(id0) +")").UTF8String();78 return makeString(ident.ustring(), "(@id", UString::from(id0), ")").UTF8String(); 82 79 } 83 80 … … 90 87 return constantName(exec, r, getConstant(r)); 91 88 92 return (UString("r") +UString::from(r)).UTF8String();89 return makeString("r", UString::from(r)).UTF8String(); 93 90 } 94 91 95 92 static UString regexpToSourceString(RegExp* regExp) 96 93 { 97 UString pattern = UString("/") + regExp->pattern() + "/"; 94 char postfix[5] = { '/', 0, 0, 0, 0 }; 95 int index = 1; 98 96 if (regExp->global()) 99 p attern += "g";97 postfix[index++] = 'g'; 100 98 if (regExp->ignoreCase()) 101 p attern += "i";99 postfix[index++] = 'i'; 102 100 if (regExp->multiline()) 103 p attern += "m";104 105 return pattern;101 postfix[index] = 'm'; 102 103 return makeString("/", regExp->pattern(), postfix); 106 104 } 107 105 108 106 static CString regexpName(int re, RegExp* regexp) 109 107 { 110 return (regexpToSourceString(regexp) + "(@re" + UString::from(re) +")").UTF8String();108 return makeString(regexpToSourceString(regexp), "(@re", UString::from(re), ")").UTF8String(); 111 109 } 112 110
Note:
See TracChangeset
for help on using the changeset viewer.