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

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

Issue 12644008: 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 | « src/arm/regexp-macro-assembler-arm.cc ('k') | src/x64/regexp-macro-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/regexp-macro-assembler-ia32.cc
diff --git a/src/ia32/regexp-macro-assembler-ia32.cc b/src/ia32/regexp-macro-assembler-ia32.cc
index 49c75e1330e97321fcec39d65a83fa64499a5166..bb0e0adb7ec4fdb1c094f6828fae879adaf0fdb3 100644
--- a/src/ia32/regexp-macro-assembler-ia32.cc
+++ b/src/ia32/regexp-macro-assembler-ia32.cc
@@ -599,29 +599,23 @@ bool RegExpMacroAssemblerIA32::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;
__ cmp(current_character(), ' ');
- __ j(equal, &success);
+ __ j(equal, &success, Label::kNear);
// Check range 0x09..0x0d
__ lea(eax, Operand(current_character(), -'\t'));
__ cmp(eax, '\r' - '\t');
- BranchOrBacktrack(above, on_no_match);
+ __ j(below_equal, &success, Label::kNear);
+ // \u00a0 (NBSP).
+ __ cmp(eax, 0x00a0 - '\t');
+ BranchOrBacktrack(not_equal, on_no_match);
__ bind(&success);
return true;
}
return false;
case 'S':
- // Match non-space characters.
- if (mode_ == ASCII) {
- // ASCII space characters are '\t'..'\r' and ' '.
- __ cmp(current_character(), ' ');
- BranchOrBacktrack(equal, on_no_match);
- __ lea(eax, Operand(current_character(), -'\t'));
- __ cmp(eax, '\r' - '\t');
- BranchOrBacktrack(below_equal, on_no_match);
- 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 | « src/arm/regexp-macro-assembler-arm.cc ('k') | src/x64/regexp-macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698