Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: src/mips/regexp-macro-assembler-mips.cc

Issue 12771005: MIPS: Fix white space matching in latin-1 strings wrt \u00a0. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/regexp-macro-assembler-mips.cc
diff --git a/src/mips/regexp-macro-assembler-mips.cc b/src/mips/regexp-macro-assembler-mips.cc
index 1ae2a7a8455385bf6e4b479dbde76adb0800320d..ce2d635d634f6e6d23b0a18f1ed72a7e029a5be7 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').
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698