Index: src/ia32/codegen-ia32.cc |
diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc |
index fd7b9cac2c50e0527544953ebabe1f40af32d18b..ccd159e2991658a55b3f3381a954d824f0a238d5 100644 |
--- a/src/ia32/codegen-ia32.cc |
+++ b/src/ia32/codegen-ia32.cc |
@@ -491,9 +491,6 @@ 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. |
__ mov(result, FieldOperand(string, HeapObject::kMapOffset)); |
__ movzx_b(result, FieldOperand(result, Map::kInstanceTypeOffset)); |
@@ -504,24 +501,17 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
__ j(zero, &check_sequential, Label::kNear); |
// Dispatch on the indirect string shape: slice or cons. |
- Label cons_string, thin_string; |
- __ and_(result, Immediate(kStringRepresentationMask)); |
- __ cmp(result, Immediate(kConsStringTag)); |
- __ j(equal, &cons_string, Label::kNear); |
- __ cmp(result, Immediate(kThinStringTag)); |
- __ j(equal, &thin_string, Label::kNear); |
+ Label cons_string; |
+ __ test(result, Immediate(kSlicedNotConsMask)); |
+ __ j(zero, &cons_string, Label::kNear); |
// Handle slices. |
+ Label indirect_string_loaded; |
__ mov(result, FieldOperand(string, SlicedString::kOffsetOffset)); |
__ SmiUntag(result); |
__ add(index, result); |
__ mov(string, FieldOperand(string, SlicedString::kParentOffset)); |
- __ jmp(&indirect_string_loaded); |
- |
- // Handle thin strings. |
- __ bind(&thin_string); |
- __ mov(string, FieldOperand(string, ThinString::kActualOffset)); |
- __ jmp(&indirect_string_loaded); |
+ __ jmp(&indirect_string_loaded, Label::kNear); |
// Handle cons strings. |
// Check whether the right hand side is the empty string (i.e. if |
@@ -533,7 +523,10 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
Immediate(factory->empty_string())); |
__ j(not_equal, call_runtime); |
__ mov(string, FieldOperand(string, ConsString::kFirstOffset)); |
- __ jmp(&indirect_string_loaded); |
+ |
+ __ bind(&indirect_string_loaded); |
+ __ mov(result, FieldOperand(string, HeapObject::kMapOffset)); |
+ __ movzx_b(result, FieldOperand(result, Map::kInstanceTypeOffset)); |
// Distinguish sequential and external strings. Only these two string |
// representations can reach here (slices and flat cons strings have been |