Index: src/ppc/codegen-ppc.cc |
diff --git a/src/ppc/codegen-ppc.cc b/src/ppc/codegen-ppc.cc |
index 212e6db11d4409deb42821cbf24ea7b8a062a122..bb365b4e632b56ad25729d71f7e55ca3b5b2ffae 100644 |
--- a/src/ppc/codegen-ppc.cc |
+++ b/src/ppc/codegen-ppc.cc |
@@ -77,9 +77,6 @@ void StubRuntimeCallHelper::AfterCall(MacroAssembler* masm) const { |
void StringCharLoadGenerator::Generate(MacroAssembler* masm, Register string, |
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. |
__ LoadP(result, FieldMemOperand(string, HeapObject::kMapOffset)); |
__ lbz(result, FieldMemOperand(result, Map::kInstanceTypeOffset)); |
@@ -89,26 +86,20 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, Register string, |
__ andi(r0, result, Operand(kIsIndirectStringMask)); |
__ beq(&check_sequential, cr0); |
- // Dispatch on the indirect string shape: slice or cons or thin. |
- Label cons_string, thin_string; |
- __ andi(ip, result, Operand(kStringRepresentationMask)); |
- __ cmpi(ip, Operand(kConsStringTag)); |
- __ beq(&cons_string); |
- __ cmpi(ip, Operand(kThinStringTag)); |
- __ beq(&thin_string); |
+ // Dispatch on the indirect string shape: slice or cons. |
+ Label cons_string; |
+ __ mov(ip, Operand(kSlicedNotConsMask)); |
+ __ and_(r0, result, ip, SetRC); |
+ __ beq(&cons_string, cr0); |
// Handle slices. |
+ Label indirect_string_loaded; |
__ LoadP(result, FieldMemOperand(string, SlicedString::kOffsetOffset)); |
__ LoadP(string, FieldMemOperand(string, SlicedString::kParentOffset)); |
__ SmiUntag(ip, result); |
__ add(index, index, ip); |
__ b(&indirect_string_loaded); |
- // Handle thin strings. |
- __ bind(&thin_string); |
- __ LoadP(string, FieldMemOperand(string, ThinString::kActualOffset)); |
- __ b(&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 |
@@ -120,7 +111,10 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm, Register string, |
__ bne(call_runtime); |
// Get the first of the two strings and load its instance type. |
__ LoadP(string, FieldMemOperand(string, ConsString::kFirstOffset)); |
- __ b(&indirect_string_loaded); |
+ |
+ __ bind(&indirect_string_loaded); |
+ __ LoadP(result, FieldMemOperand(string, HeapObject::kMapOffset)); |
+ __ lbz(result, FieldMemOperand(result, Map::kInstanceTypeOffset)); |
// Distinguish sequential and external strings. Only these two string |
// representations can reach here (slices and flat cons strings have been |