Index: src/regexp-macro-assembler.cc |
diff --git a/src/regexp-macro-assembler.cc b/src/regexp-macro-assembler.cc |
index 55782431bec353820f868b71b94b4d4cb0a661e6..a48cb0c54681eee6be6ed188c1fef51bc3586680 100644 |
--- a/src/regexp-macro-assembler.cc |
+++ b/src/regexp-macro-assembler.cc |
@@ -74,6 +74,12 @@ bool NativeRegExpMacroAssembler::CanReadUnaligned() { |
const byte* NativeRegExpMacroAssembler::StringCharacterPosition( |
String* subject, |
int start_index) { |
+ // Unpack sliced string. |
+ if (subject->IsSlicedString()) { |
+ SlicedString* slice = SlicedString::cast(subject); |
+ subject = slice->parent(); |
+ start_index += slice->offset(); |
+ } |
// Not just flat, but ultra flat. |
ASSERT(subject->IsExternalString() || subject->IsSeqString()); |
ASSERT(start_index >= 0); |
@@ -130,7 +136,9 @@ NativeRegExpMacroAssembler::Result NativeRegExpMacroAssembler::Match( |
} |
// Ensure that an underlying string has the same ascii-ness. |
bool is_ascii = subject_ptr->IsAsciiRepresentation(); |
- ASSERT(subject_ptr->IsExternalString() || subject_ptr->IsSeqString()); |
+ ASSERT(subject_ptr->IsExternalString() || |
+ subject_ptr->IsSeqString() || |
+ subject_ptr->IsSlicedString()); |
// String is now either Sequential or External |
int char_size_shift = is_ascii ? 0 : 1; |
int char_length = end_offset - start_offset; |