Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index e2a313372e6be6e4501a46aa5740182b911676c7..effa6080e9a7e419a1eec16c29eecb48318276d7 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -5088,23 +5088,26 @@ void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { |
__ cmp(result_, Operand(ip)); |
__ b(ne, &call_runtime_); |
// Get the first of the two strings and load its instance type. |
- __ ldr(object_, FieldMemOperand(object_, ConsString::kFirstOffset)); |
+ __ ldr(result_, FieldMemOperand(object_, ConsString::kFirstOffset)); |
__ jmp(&assure_seq_string); |
// SlicedString, unpack and add offset. |
__ bind(&sliced_string); |
__ ldr(result_, FieldMemOperand(object_, SlicedString::kOffsetOffset)); |
__ add(scratch_, scratch_, result_); |
- __ ldr(object_, FieldMemOperand(object_, SlicedString::kParentOffset)); |
+ __ ldr(result_, FieldMemOperand(object_, SlicedString::kParentOffset)); |
// Assure that we are dealing with a sequential string. Go to runtime if not. |
__ bind(&assure_seq_string); |
- __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
+ __ ldr(result_, FieldMemOperand(result_, HeapObject::kMapOffset)); |
__ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
// Check that parent is not an external string. Go to runtime otherwise. |
STATIC_ASSERT(kSeqStringTag == 0); |
__ tst(result_, Operand(kStringRepresentationMask)); |
__ b(ne, &call_runtime_); |
+ // Actually fetch the parent string if it is confirmed to be sequential. |
+ STATIC_ASSERT(SlicedString::kParentOffset == ConsString::kFirstOffset); |
+ __ ldr(object_, FieldMemOperand(object_, SlicedString::kParentOffset)); |
// Check for 1-byte or 2-byte string. |
__ bind(&flat_string); |