Reviewers: Rico,

Description:
Fix compile problem on ARM. Remove unused argument.

Please review this at http://codereview.chromium.org/5455001/

Affected files:
  M src/runtime.cc


Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 3691fe6a704ae66c7c3d23a786901244493028e9..9c8f6ed0b9c3dc582ae8c01920cc36aa1baacfdb 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,
@@ -4613,8 +4615,7 @@ static MaybeObject* QuoteJsonString(String* original,
   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 +4645,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)];


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to