Index: src/mips/codegen-mips.cc |
diff --git a/src/mips/codegen-mips.cc b/src/mips/codegen-mips.cc |
index a57299abf67bc55042bc764ca7069a9a0e3cf166..beab163acee243a7bc3b752fa9f10829d0dde5e6 100644 |
--- a/src/mips/codegen-mips.cc |
+++ b/src/mips/codegen-mips.cc |
@@ -610,6 +610,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. |
__ lw(result, FieldMemOperand(string, HeapObject::kMapOffset)); |
__ lbu(result, FieldMemOperand(result, Map::kInstanceTypeOffset)); |
@@ -620,18 +623,23 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
__ Branch(&check_sequential, eq, at, Operand(zero_reg)); |
// Dispatch on the indirect string shape: slice or cons. |
- Label cons_string; |
- __ And(at, result, Operand(kSlicedNotConsMask)); |
- __ Branch(&cons_string, eq, at, Operand(zero_reg)); |
+ Label cons_string, thin_string; |
+ __ And(at, result, Operand(kStringRepresentationMask)); |
+ __ Branch(&cons_string, eq, at, Operand(kConsStringTag)); |
+ __ Branch(&thin_string, eq, at, Operand(kThinStringTag)); |
// Handle slices. |
- Label indirect_string_loaded; |
__ lw(result, FieldMemOperand(string, SlicedString::kOffsetOffset)); |
__ lw(string, FieldMemOperand(string, SlicedString::kParentOffset)); |
__ sra(at, result, kSmiTagSize); |
__ Addu(index, index, at); |
__ jmp(&indirect_string_loaded); |
+ // Handle thin strings. |
+ __ bind(&thin_string); |
+ __ lw(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 |
@@ -643,10 +651,7 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
__ Branch(call_runtime, ne, result, Operand(at)); |
// Get the first of the two strings and load its instance type. |
__ lw(string, FieldMemOperand(string, ConsString::kFirstOffset)); |
- |
- __ bind(&indirect_string_loaded); |
- __ lw(result, FieldMemOperand(string, HeapObject::kMapOffset)); |
- __ lbu(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 |