Drop latin-1 check from BasicJsonStringifier::DoNotEscape

R=yangguo@chromium.org
BUG=

Review URL: https://codereview.chromium.org/12207153

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13660 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
dcarney@chromium.org 2013-02-13 14:55:33 +00:00
parent a7cc374b38
commit 5db57ed97c

View File

@ -206,8 +206,39 @@ const char* const BasicJsonStringifier::JsonEscapeTable =
"p\0 q\0 r\0 s\0 "
"t\0 u\0 v\0 w\0 "
"x\0 y\0 z\0 {\0 "
"|\0 }\0 ~\0 \177\0 ";
"|\0 }\0 ~\0 \177\0 "
"\200\0 \201\0 \202\0 \203\0 "
"\204\0 \205\0 \206\0 \207\0 "
"\210\0 \211\0 \212\0 \213\0 "
"\214\0 \215\0 \216\0 \217\0 "
"\220\0 \221\0 \222\0 \223\0 "
"\224\0 \225\0 \226\0 \227\0 "
"\230\0 \231\0 \232\0 \233\0 "
"\234\0 \235\0 \236\0 \237\0 "
"\240\0 \241\0 \242\0 \243\0 "
"\244\0 \245\0 \246\0 \247\0 "
"\250\0 \251\0 \252\0 \253\0 "
"\254\0 \255\0 \256\0 \257\0 "
"\260\0 \261\0 \262\0 \263\0 "
"\264\0 \265\0 \266\0 \267\0 "
"\270\0 \271\0 \272\0 \273\0 "
"\274\0 \275\0 \276\0 \277\0 "
"\300\0 \301\0 \302\0 \303\0 "
"\304\0 \305\0 \306\0 \307\0 "
"\310\0 \311\0 \312\0 \313\0 "
"\314\0 \315\0 \316\0 \317\0 "
"\320\0 \321\0 \322\0 \323\0 "
"\324\0 \325\0 \326\0 \327\0 "
"\330\0 \331\0 \332\0 \333\0 "
"\334\0 \335\0 \336\0 \337\0 "
"\340\0 \341\0 \342\0 \343\0 "
"\344\0 \345\0 \346\0 \347\0 "
"\350\0 \351\0 \352\0 \353\0 "
"\354\0 \355\0 \356\0 \357\0 "
"\360\0 \361\0 \362\0 \363\0 "
"\364\0 \365\0 \366\0 \367\0 "
"\370\0 \371\0 \372\0 \373\0 "
"\374\0 \375\0 \376\0 \377\0 ";
BasicJsonStringifier::BasicJsonStringifier(Isolate* isolate)
: isolate_(isolate), current_index_(0), is_ascii_(true) {
@ -698,9 +729,15 @@ void BasicJsonStringifier::SerializeString_(Handle<String> string) {
}
template <typename Char>
bool BasicJsonStringifier::DoNotEscape(Char c) {
return (c >= 0x80) || (c >= '#' && c <= '~' && c != '\\');
template <>
bool BasicJsonStringifier::DoNotEscape(uint8_t c) {
return c >= '#' && c <= '~' && c != '\\';
}
template <>
bool BasicJsonStringifier::DoNotEscape(uint16_t c) {
return c >= '#' && c != '\\' && c != 0x7f;
}