Commit 8624fb85 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Tiny improvements on fast element conversion loops in ia32 and x64.

Review URL: http://codereview.chromium.org/8403035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9820 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1dd59838
......@@ -355,9 +355,7 @@ void ElementsTransitionGenerator::GenerateSmiOnlyToDouble(
// Convert and copy elements
// esi: source FixedArray
// edi: number of elements to convert/copy
__ bind(&loop);
__ sub(edi, Immediate(Smi::FromInt(1)));
__ mov(ebx, FieldOperand(esi, edi, times_2, FixedArray::kHeaderSize));
// ebx: current element from source
// edi: index of current element
......@@ -390,8 +388,8 @@ void ElementsTransitionGenerator::GenerateSmiOnlyToDouble(
}
__ bind(&entry);
__ test(edi, edi);
__ j(not_zero, &loop);
__ sub(edi, Immediate(Smi::FromInt(1)));
__ j(not_sign, &loop);
__ pop(ebx);
__ pop(eax);
......@@ -454,7 +452,6 @@ void ElementsTransitionGenerator::GenerateDoubleToObject(
// edi: source FixedDoubleArray
// eax: destination FixedArray
__ bind(&loop);
__ sub(ebx, Immediate(Smi::FromInt(1)));
// ebx: index of current element (smi-tagged)
uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32);
__ cmp(FieldOperand(edi, ebx, times_4, offset), Immediate(kHoleNanUpper32));
......@@ -490,8 +487,8 @@ void ElementsTransitionGenerator::GenerateDoubleToObject(
masm->isolate()->factory()->the_hole_value());
__ bind(&entry);
__ test(ebx, ebx);
__ j(not_zero, &loop);
__ sub(ebx, Immediate(Smi::FromInt(1)));
__ j(not_sign, &loop);
__ pop(ebx);
__ pop(edx);
......
......@@ -243,7 +243,6 @@ void ElementsTransitionGenerator::GenerateSmiOnlyToDouble(
// Conversion loop.
__ bind(&loop);
__ decq(r9);
__ movq(rbx,
FieldOperand(r8, r9, times_8, FixedArray::kHeaderSize));
// r9 : current element's index
......@@ -257,8 +256,8 @@ void ElementsTransitionGenerator::GenerateSmiOnlyToDouble(
__ bind(&convert_hole);
__ movq(FieldOperand(r14, r9, times_8, FixedDoubleArray::kHeaderSize), r15);
__ bind(&entry);
__ testq(r9, r9);
__ j(not_zero, &loop);
__ decq(r9);
__ j(not_sign, &loop);
}
......@@ -301,7 +300,6 @@ void ElementsTransitionGenerator::GenerateDoubleToObject(
// Box doubles into heap numbers.
__ bind(&loop);
__ decq(r9);
__ movq(r14, FieldOperand(r8,
r9,
times_pointer_size,
......@@ -338,8 +336,8 @@ void ElementsTransitionGenerator::GenerateDoubleToObject(
rdi);
__ bind(&entry);
__ testq(r9, r9);
__ j(not_zero, &loop);
__ decq(r9);
__ j(not_sign, &loop);
// Set transitioned map.
__ movq(FieldOperand(rdx, HeapObject::kMapOffset), rbx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment