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