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:
parent
8dc25d2b29
commit
3e64d6905a
@ -541,25 +541,20 @@ bool RegExpMacroAssemblerMIPS::CheckSpecialCharacterClass(uc16 type,
|
|||||||
case 's':
|
case 's':
|
||||||
// Match space-characters.
|
// Match space-characters.
|
||||||
if (mode_ == ASCII) {
|
if (mode_ == ASCII) {
|
||||||
// ASCII space characters are '\t'..'\r' and ' '.
|
// One byte space characters are '\t'..'\r', ' ' and \u00a0.
|
||||||
Label success;
|
Label success;
|
||||||
__ Branch(&success, eq, current_character(), Operand(' '));
|
__ Branch(&success, eq, current_character(), Operand(' '));
|
||||||
// Check range 0x09..0x0d.
|
// Check range 0x09..0x0d.
|
||||||
__ Subu(a0, current_character(), Operand('\t'));
|
__ 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);
|
__ bind(&success);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case 'S':
|
case 'S':
|
||||||
// Match non-space characters.
|
// The emitted code for generic character classes is good enough.
|
||||||
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;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
case 'd':
|
case 'd':
|
||||||
// Match ASCII digits ('0'..'9').
|
// Match ASCII digits ('0'..'9').
|
||||||
|
Loading…
Reference in New Issue
Block a user