Index: src/x64/regexp-macro-assembler-x64.cc |
diff --git a/src/x64/regexp-macro-assembler-x64.cc b/src/x64/regexp-macro-assembler-x64.cc |
index f5b5e954ad3bb9f3ba97641df73859473504a4b3..c9871f0e47326352ca7a61331c36127c9b083292 100644 |
--- a/src/x64/regexp-macro-assembler-x64.cc |
+++ b/src/x64/regexp-macro-assembler-x64.cc |
@@ -640,29 +640,23 @@ bool RegExpMacroAssemblerX64::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; |
__ cmpl(current_character(), Immediate(' ')); |
- __ j(equal, &success); |
+ __ j(equal, &success, Label::kNear); |
// Check range 0x09..0x0d |
__ lea(rax, Operand(current_character(), -'\t')); |
__ cmpl(rax, Immediate('\r' - '\t')); |
- BranchOrBacktrack(above, on_no_match); |
+ __ j(below_equal, &success, Label::kNear); |
+ // \u00a0 (NBSP). |
+ __ cmpl(rax, Immediate(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 ' '. |
- __ cmpl(current_character(), Immediate(' ')); |
- BranchOrBacktrack(equal, on_no_match); |
- __ lea(rax, Operand(current_character(), -'\t')); |
- __ cmpl(rax, Immediate('\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') |