From 544d445ea61bf98961b065b34d5c02c026806bb9 Mon Sep 17 00:00:00 2001 From: "alexandre.rames@arm.com" Date: Tue, 18 Feb 2014 09:59:02 +0000 Subject: [PATCH] A64: Optimize a loop by using post-indexing. R=ulan@chromium.org Review URL: https://codereview.chromium.org/169543002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19429 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/a64/full-codegen-a64.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/a64/full-codegen-a64.cc b/src/a64/full-codegen-a64.cc index eca3f06..ec5d339 100644 --- a/src/a64/full-codegen-a64.cc +++ b/src/a64/full-codegen-a64.cc @@ -2805,16 +2805,13 @@ void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( // Loop through all the keys in the descriptor array. If one of these is the // string "valueOf" the result is false. - // TODO(all): optimise this loop to combine the add and ldr into an - // addressing mode. Register valueof_string = x1; + int descriptor_size = DescriptorArray::kDescriptorSize * kPointerSize; __ Mov(valueof_string, Operand(isolate()->factory()->value_of_string())); __ Bind(&loop); - __ Ldr(x15, MemOperand(descriptors)); + __ Ldr(x15, MemOperand(descriptors, descriptor_size, PostIndex)); __ Cmp(x15, valueof_string); __ B(eq, if_false); - __ Add(descriptors, descriptors, - DescriptorArray::kDescriptorSize * kPointerSize); __ Cmp(descriptors, descriptors_end); __ B(ne, &loop); -- 2.7.4