From: palfia@homejinni.com Date: Mon, 11 Mar 2013 14:17:32 +0000 (+0000) Subject: MIPS: Fix white space matching in latin-1 strings wrt \u00a0. X-Git-Tag: upstream/4.7.83~14880 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e64d6905a4f7e8d314232fd282edfaa26f9e58c;p=platform%2Fupstream%2Fv8.git MIPS: Fix white space matching in latin-1 strings wrt \u00a0. Port r13898 (bcc5b57f) BUG= Review URL: https://codereview.chromium.org/12771005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13906 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/regexp-macro-assembler-mips.cc b/src/mips/regexp-macro-assembler-mips.cc index 1ae2a7a..ce2d635 100644 --- a/src/mips/regexp-macro-assembler-mips.cc +++ b/src/mips/regexp-macro-assembler-mips.cc @@ -541,25 +541,20 @@ bool RegExpMacroAssemblerMIPS::CheckSpecialCharacterClass(uc16 type, case 's': // Match space-characters. if (mode_ == ASCII) { - // ASCII space characters are '\t'..'\r' and ' '. + // One byte space characters are '\t'..'\r', ' ' and \u00a0. Label success; __ Branch(&success, eq, current_character(), Operand(' ')); // Check range 0x09..0x0d. __ Subu(a0, current_character(), Operand('\t')); - BranchOrBacktrack(on_no_match, hi, a0, Operand('\r' - '\t')); + __ Branch(&success, ls, a0, Operand('\r' - '\t')); + // \u00a0 (NBSP). + BranchOrBacktrack(on_no_match, ne, a0, Operand(0x00a0 - '\t')); __ bind(&success); return true; } return false; case 'S': - // Match non-space characters. - if (mode_ == ASCII) { - // ASCII space characters are '\t'..'\r' and ' '. - BranchOrBacktrack(on_no_match, eq, current_character(), Operand(' ')); - __ Subu(a0, current_character(), Operand('\t')); - BranchOrBacktrack(on_no_match, ls, a0, Operand('\r' - '\t')); - return true; - } + // The emitted code for generic character classes is good enough. return false; case 'd': // Match ASCII digits ('0'..'9').