Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index b8f820d7f5581e9727731f61fa8481a751258aa0..3c0d11b09c0389a4804a1764a7bd5f5472be2c7e 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -2663,10 +2663,15 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
Label cons_string, check_encoding; |
STATIC_ASSERT(kConsStringTag < kExternalStringTag); |
STATIC_ASSERT(kSlicedStringTag > kExternalStringTag); |
+ STATIC_ASSERT(kIsNotStringMask > kExternalStringTag); |
__ cmpq(rbx, Immediate(kExternalStringTag)); |
__ j(less, &cons_string, Label::kNear); |
__ j(equal, &runtime); |
+ // Catch non-string subject (should already have been guarded against). |
+ __ testb(ebx, Immediate(kIsNotStringMask)); |
+ __ j(zero, &runtime); |
+ |
// String is sliced. |
__ SmiToInteger32(r14, FieldOperand(rdi, SlicedString::kOffsetOffset)); |
__ movq(rdi, FieldOperand(rdi, SlicedString::kParentOffset)); |