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
This commit is contained in:
palfia@homejinni.com 2013-03-11 14:17:32 +00:00
parent 8dc25d2b29
commit 3e64d6905a

View File

@ -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').