Reviewers: Erik Corry, Description: ARM: Fix heap number allocation in lithium-codegen-arm that assumed that ip can be used as a scratch register. This is not true because ip is already used for something else in AllocateInNewSpace in the macro assembler.
Explicitly allocate a temp register for use in the heap number allocation instead. Please review this at http://codereview.chromium.org/5788001/ SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/arm/lithium-arm.h M src/arm/lithium-arm.cc M src/arm/lithium-codegen-arm.cc Index: src/arm/lithium-arm.cc =================================================================== --- src/arm/lithium-arm.cc (revision 5966) +++ src/arm/lithium-arm.cc (working copy) @@ -1691,11 +1691,13 @@ } else if (from.IsDouble()) { if (to.IsTagged()) { LOperand* value = UseRegister(instr->value()); - LOperand* temp = TempRegister(); + LOperand* temp1 = TempRegister(); + LOperand* temp2 = TempRegister(); - // Make sure that temp and result_temp are different registers. + // Make sure that the temp and result_temp registers are + // different. LUnallocated* result_temp = TempRegister(); - LInstruction* result = new LNumberTagD(value, temp); + LInstruction* result = new LNumberTagD(value, temp1, temp2); Define(result, result_temp); return AssignPointerMap(result); } else { Index: src/arm/lithium-arm.h =================================================================== --- src/arm/lithium-arm.h (revision 5966) +++ src/arm/lithium-arm.h (working copy) @@ -1395,15 +1395,17 @@ class LNumberTagD: public LUnaryOperation { public: - explicit LNumberTagD(LOperand* value, LOperand* temp) - : LUnaryOperation(value), temp_(temp) { } + explicit LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2) + : LUnaryOperation(value), temp1_(temp1), temp2_(temp2) { } DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") - LOperand* temp() const { return temp_; } + LOperand* temp1() const { return temp1_; } + LOperand* temp2() const { return temp2_; } private: - LOperand* temp_; + LOperand* temp1_; + LOperand* temp2_; }; Index: src/arm/lithium-codegen-arm.cc =================================================================== --- src/arm/lithium-codegen-arm.cc (revision 5966) +++ src/arm/lithium-codegen-arm.cc (working copy) @@ -1733,13 +1733,14 @@ DoubleRegister input_reg = ToDoubleRegister(instr->input()); Register reg = ToRegister(instr->result()); - Register tmp = ToRegister(instr->temp()); + Register temp1 = ToRegister(instr->temp1()); + Register temp2 = ToRegister(instr->temp2()); Register scratch = r9; DeferredNumberTagD* deferred = new DeferredNumberTagD(this, instr); if (FLAG_inline_new) { __ LoadRoot(scratch, Heap::kHeapNumberMapRootIndex); - __ AllocateHeapNumber(reg, tmp, ip, scratch, deferred->entry()); + __ AllocateHeapNumber(reg, temp1, temp2, scratch, deferred->entry()); } else { __ jmp(deferred->entry()); } -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
