Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 60a8322d363a85da4104be5e86c44c24a309ddb8..4a4aa17178561437e70214b479533f47c223b516 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -1297,7 +1297,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
// (6) External string. Make it, offset-wise, look like a sequential string. |
// Go to (4). |
// (7) Short external string or not a string? If yes, bail out to runtime. |
- // (8) Sliced string. Replace subject with parent. Go to (1). |
+ // (8) Sliced or thin string. Replace subject with parent. Go to (1). |
Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */, |
not_seq_nor_cons /* 5 */, not_long_external /* 7 */; |
@@ -1319,6 +1319,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
// (2) Sequential or cons? If not, go to (5). |
STATIC_ASSERT(kConsStringTag < kExternalStringTag); |
STATIC_ASSERT(kSlicedStringTag > kExternalStringTag); |
+ STATIC_ASSERT(kThinStringTag > kExternalStringTag); |
STATIC_ASSERT(kIsNotStringMask > kExternalStringTag); |
STATIC_ASSERT(kShortExternalStringTag > kExternalStringTag); |
__ cmp(r1, Operand(kExternalStringTag)); |
@@ -1346,10 +1347,10 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
__ b(ls, &runtime); |
__ SmiUntag(r1); |
- STATIC_ASSERT(4 == kOneByteStringTag); |
+ STATIC_ASSERT(8 == kOneByteStringTag); |
STATIC_ASSERT(kTwoByteStringTag == 0); |
__ and_(r0, r0, Operand(kStringEncodingMask)); |
- __ mov(r3, Operand(r0, ASR, 2), SetCC); |
+ __ mov(r3, Operand(r0, ASR, 3), SetCC); |
__ ldr(r6, FieldMemOperand(regexp_data, JSRegExp::kDataOneByteCodeOffset), |
ne); |
__ ldr(r6, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset), eq); |
@@ -1583,12 +1584,19 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
__ tst(r1, Operand(kIsNotStringMask | kShortExternalStringMask)); |
__ b(ne, &runtime); |
- // (8) Sliced string. Replace subject with parent. Go to (4). |
+ // (8) Sliced or thin string. Replace subject with parent. Go to (4). |
+ Label thin_string; |
+ __ cmp(r1, Operand(kThinStringTag)); |
+ __ b(eq, &thin_string); |
// Load offset into r9 and replace subject string with parent. |
__ ldr(r9, FieldMemOperand(subject, SlicedString::kOffsetOffset)); |
__ SmiUntag(r9); |
__ ldr(subject, FieldMemOperand(subject, SlicedString::kParentOffset)); |
__ jmp(&check_underlying); // Go to (4). |
+ |
+ __ bind(&thin_string); |
+ __ ldr(subject, FieldMemOperand(subject, ThinString::kActualOffset)); |
+ __ jmp(&check_underlying); // Go to (4). |
#endif // V8_INTERPRETED_REGEXP |
} |