Index: src/arm/codegen-arm.cc |
diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc |
index 06e92168b6f7c1a2e6966d0e8af408de9ef936a9..934875220ca02b657e0701ca4457e53eec7a6807 100644 |
--- a/src/arm/codegen-arm.cc |
+++ b/src/arm/codegen-arm.cc |
@@ -322,6 +322,9 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
Register index, |
Register result, |
Label* call_runtime) { |
+ Label indirect_string_loaded; |
+ __ bind(&indirect_string_loaded); |
+ |
// Fetch the instance type of the receiver into result register. |
__ ldr(result, FieldMemOperand(string, HeapObject::kMapOffset)); |
__ ldrb(result, FieldMemOperand(result, Map::kInstanceTypeOffset)); |
@@ -332,17 +335,24 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
__ b(eq, &check_sequential); |
// Dispatch on the indirect string shape: slice or cons. |
- Label cons_string; |
- __ tst(result, Operand(kSlicedNotConsMask)); |
+ Label cons_string, thin_string; |
+ __ and_(result, result, Operand(kStringRepresentationMask)); |
+ __ cmp(result, Operand(kConsStringTag)); |
__ b(eq, &cons_string); |
+ __ cmp(result, Operand(kThinStringTag)); |
+ __ b(eq, &thin_string); |
// Handle slices. |
- Label indirect_string_loaded; |
__ ldr(result, FieldMemOperand(string, SlicedString::kOffsetOffset)); |
__ ldr(string, FieldMemOperand(string, SlicedString::kParentOffset)); |
__ add(index, index, Operand::SmiUntag(result)); |
__ jmp(&indirect_string_loaded); |
+ // Handle thin strings. |
+ __ bind(&thin_string); |
+ __ ldr(string, FieldMemOperand(string, ThinString::kActualOffset)); |
+ __ jmp(&indirect_string_loaded); |
+ |
// Handle cons strings. |
// Check whether the right hand side is the empty string (i.e. if |
// this is really a flat string in a cons string). If that is not |
@@ -354,10 +364,7 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
__ b(ne, call_runtime); |
// Get the first of the two strings and load its instance type. |
__ ldr(string, FieldMemOperand(string, ConsString::kFirstOffset)); |
- |
- __ bind(&indirect_string_loaded); |
- __ ldr(result, FieldMemOperand(string, HeapObject::kMapOffset)); |
- __ ldrb(result, FieldMemOperand(result, Map::kInstanceTypeOffset)); |
+ __ jmp(&indirect_string_loaded); |
// Distinguish sequential and external strings. Only these two string |
// representations can reach here (slices and flat cons strings have been |