From 50360315201716c66e55a1680adf8372f599ec12 Mon Sep 17 00:00:00 2001 From: "alexandre.rames@arm.com" Date: Thu, 20 Mar 2014 11:35:05 +0000 Subject: [PATCH] A64: Minor cleaning in StoreStubCompiler::GenerateStoreField. Abstract a register to simplify code generation. R=ulan@chromium.org Review URL: https://codereview.chromium.org/206183005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20116 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/a64/stub-cache-a64.cc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/a64/stub-cache-a64.cc b/src/a64/stub-cache-a64.cc index 71b2150..1e59c0e 100644 --- a/src/a64/stub-cache-a64.cc +++ b/src/a64/stub-cache-a64.cc @@ -461,16 +461,11 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, // TODO(verwaest): Share this code as a code stub. SmiCheck smi_check = representation.IsTagged() ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; + Register prop_reg = representation.IsDouble() ? storage_reg : value_reg; if (index < 0) { // Set the property straight into the object. int offset = object->map()->instance_size() + (index * kPointerSize); - // TODO(jbramley): This construct appears in several places in this - // function. Try to clean it up, perhaps using a result_reg. - if (representation.IsDouble()) { - __ Str(storage_reg, FieldMemOperand(receiver_reg, offset)); - } else { - __ Str(value_reg, FieldMemOperand(receiver_reg, offset)); - } + __ Str(prop_reg, FieldMemOperand(receiver_reg, offset)); if (!representation.IsSmi()) { // Update the write barrier for the array address. @@ -492,11 +487,7 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, // Get the properties array __ Ldr(scratch1, FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); - if (representation.IsDouble()) { - __ Str(storage_reg, FieldMemOperand(scratch1, offset)); - } else { - __ Str(value_reg, FieldMemOperand(scratch1, offset)); - } + __ Str(prop_reg, FieldMemOperand(scratch1, offset)); if (!representation.IsSmi()) { // Update the write barrier for the array address. -- 2.7.4