Index: src/regexp/regexp-macro-assembler.cc |
diff --git a/src/regexp/regexp-macro-assembler.cc b/src/regexp/regexp-macro-assembler.cc |
index 21f4f8a1b011b069857a09af97966ec2bdb18d72..9bb5073a8b21bc1d6a3a397653867de5b748709a 100644 |
--- a/src/regexp/regexp-macro-assembler.cc |
+++ b/src/regexp/regexp-macro-assembler.cc |
@@ -88,6 +88,19 @@ int RegExpMacroAssembler::CaseInsensitiveCompareUC16(Address byte_offset1, |
} |
+void RegExpMacroAssembler::CheckNotInSurrogatePair(int cp_offset, |
+ Label* on_failure) { |
+ Label ok; |
+ // Check that current character is not a trail surrogate. |
+ LoadCurrentCharacter(cp_offset, &ok); |
+ CheckCharacterNotInRange(kTrailSurrogateStart, kTrailSurrogateEnd, &ok); |
+ // Check that previous character is not a lead surrogate. |
+ LoadCurrentCharacter(cp_offset - 1, &ok); |
+ CheckCharacterInRange(kLeadSurrogateStart, kLeadSurrogateEnd, on_failure); |
+ Bind(&ok); |
+} |
+ |
+ |
#ifndef V8_INTERPRETED_REGEXP // Avoid unused code, e.g., on ARM. |
NativeRegExpMacroAssembler::NativeRegExpMacroAssembler(Isolate* isolate, |