Index: src/ia32/full-codegen-ia32.cc |
=================================================================== |
--- src/ia32/full-codegen-ia32.cc (revision 6942) |
+++ src/ia32/full-codegen-ia32.cc (working copy) |
@@ -3417,7 +3417,7 @@ |
void FullCodeGenerator::EmitFastAsciiArrayJoin(ZoneList<Expression*>* args) { |
Label bailout, done, one_char_separator, long_separator, |
- non_trivial_array, not_size_one_array, loop, loop_condition, |
+ non_trivial_array, not_size_one_array, loop, |
loop_1, loop_1_condition, loop_2, loop_2_entry, loop_3, loop_3_entry; |
ASSERT(args->length() == 2); |
@@ -3459,7 +3459,7 @@ |
// If the array has length zero, return the empty string. |
__ mov(array_length, FieldOperand(array, JSArray::kLengthOffset)); |
- __ sar(array_length, 1); |
+ __ SmiUntag(array_length); |
__ j(not_zero, &non_trivial_array); |
__ mov(result_operand, Factory::empty_string()); |
__ jmp(&done); |
@@ -3482,14 +3482,15 @@ |
// Loop condition: while (index < length). |
// Live loop registers: index, array_length, string, |
// scratch, string_length, elements. |
- __ jmp(&loop_condition); |
+ if (FLAG_debug_code) { |
+ __ cmp(index, Operand(array_length)); |
+ __ Assert(less, "No empty arrays here in EmitFastAsciiArrayJoin"); |
+ } |
__ bind(&loop); |
- __ cmp(index, Operand(array_length)); |
- __ j(greater_equal, &done); |
- |
- __ mov(string, FieldOperand(elements, index, |
- times_pointer_size, |
- FixedArray::kHeaderSize)); |
+ __ mov(string, FieldOperand(elements, |
+ index, |
+ times_pointer_size, |
+ FixedArray::kHeaderSize)); |
__ test(string, Immediate(kSmiTagMask)); |
__ j(zero, &bailout); |
__ mov(scratch, FieldOperand(string, HeapObject::kMapOffset)); |
@@ -3502,7 +3503,6 @@ |
FieldOperand(string, SeqAsciiString::kLengthOffset)); |
__ j(overflow, &bailout); |
__ add(Operand(index), Immediate(1)); |
- __ bind(&loop_condition); |
__ cmp(index, Operand(array_length)); |
__ j(less, &loop); |