Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: src/runtime.cc

Issue 5455001: Fix compile problem on ARM. Remove unused argument. (Closed)
Patch Set: Actually remove parameter. Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 3691fe6a704ae66c7c3d23a786901244493028e9..d7f2798bd5244c16effb692e27f7a9b87aced2bb 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -4521,7 +4521,9 @@ static MaybeObject* Runtime_URIUnescape(Arguments args) {
}
-static const char* const JsonQuotes[128] = {
+static const unsigned int kQuoteTableLength = 128u;
+
+static const char* const JsonQuotes[kQuoteTableLength] = {
"\\u0000", "\\u0001", "\\u0002", "\\u0003",
"\\u0004", "\\u0005", "\\u0006", "\\u0007",
"\\b", "\\t", "\\n", "\\u000b",
@@ -4557,7 +4559,7 @@ static const char* const JsonQuotes[128] = {
};
-static const byte JsonQuoteLengths[128] = {
+static const byte JsonQuoteLengths[kQuoteTableLength] = {
6, 6, 6, 6, 6, 6, 6, 6,
2, 2, 2, 6, 2, 2, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
@@ -4606,15 +4608,13 @@ MaybeObject* AllocateRawString<SeqAsciiString>(int length) {
template <typename Char, typename StringType>
-static MaybeObject* QuoteJsonString(String* original,
- Vector<const Char> characters) {
+static MaybeObject* QuoteJsonString(Vector<const Char> characters) {
int length = characters.length();
int quoted_length = 0;
for (int i = 0; i < length; i++) {
unsigned int c = characters[i];
if (sizeof(Char) > 1u) {
- quoted_length +=
- (c >= sizeof(JsonQuoteLengths)) ? 1 : JsonQuoteLengths[c];
+ quoted_length += (c >= kQuoteTableLength) ? 1 : JsonQuoteLengths[c];
} else {
quoted_length += JsonQuoteLengths[c];
}
@@ -4644,7 +4644,7 @@ static MaybeObject* QuoteJsonString(String* original,
const Char* end = read_cursor + length;
while (read_cursor < end) {
Char c = *(read_cursor++);
- if (sizeof(Char) > 1u && static_cast<unsigned>(c) >= sizeof(JsonQuotes)) {
+ if (sizeof(Char) > 1u && static_cast<unsigned>(c) >= kQuoteTableLength) {
*(write_cursor++) = c;
} else {
const char* replacement = JsonQuotes[static_cast<unsigned>(c)];
@@ -4675,9 +4675,9 @@ static MaybeObject* Runtime_QuoteJSONString(Arguments args) {
ASSERT(str->IsFlat());
}
if (str->IsTwoByteRepresentation()) {
- return QuoteJsonString<uc16, SeqTwoByteString>(str, str->ToUC16Vector());
+ return QuoteJsonString<uc16, SeqTwoByteString>(str->ToUC16Vector());
} else {
- return QuoteJsonString<char, SeqAsciiString>(str, str->ToAsciiVector());
+ return QuoteJsonString<char, SeqAsciiString>(str->ToAsciiVector());
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698