LGTM. The comment for LoadFloatOperand might say that it destroys the value in 'number'.
On Thu, Aug 6, 2009 at 3:40 PM, <[email protected]> wrote: > Reviewers: Kevin Millikin, > > Description: > Make sure use of eax in inlined sin and cos is safe. > > Please review this at http://codereview.chromium.org/164061 > > SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ > > Affected files: > M src/ia32/codegen-ia32.cc > > > Index: src/ia32/codegen-ia32.cc > =================================================================== > --- src/ia32/codegen-ia32.cc (revision 2635) > +++ src/ia32/codegen-ia32.cc (working copy) > @@ -754,9 +754,9 @@ > public: > // Code pattern for loading a floating point value. Input value must > // be either a smi or a heap number object (fp value). Requirements: > - // operand on TOS+1. Returns operand as floating point number on FPU > - // stack. > - static void LoadFloatOperand(MacroAssembler* masm, Register scratch); > + // operand in register number. Returns operand as floating point number > + // on FPU stack. > + static void LoadFloatOperand(MacroAssembler* masm, Register number); > // Code pattern for loading floating point values. Input values must > // be either smi or heap number objects (fp values). Requirements: > // operand_1 on TOS+1 , operand_2 on TOS+2; Returns operands as > @@ -5164,8 +5164,11 @@ > } > > // Go slow case if argument to operation is out of range. > + Result eax_reg = allocator_->Allocate(eax); > + ASSERT(eax_reg.is_valid()); > __ fnstsw_ax(); > __ sahf(); > + eax_reg.Unuse(); > call_runtime.Branch(parity_even, not_taken); > > // Allocate heap number for result if possible. > @@ -6964,19 +6967,19 @@ > > > void FloatingPointHelper::LoadFloatOperand(MacroAssembler* masm, > - Register scratch) { > + Register number) { > Label load_smi, done; > > - __ test(scratch, Immediate(kSmiTagMask)); > + __ test(number, Immediate(kSmiTagMask)); > __ j(zero, &load_smi, not_taken); > - __ fld_d(FieldOperand(scratch, HeapNumber::kValueOffset)); > + __ fld_d(FieldOperand(number, HeapNumber::kValueOffset)); > __ jmp(&done); > > __ bind(&load_smi); > - __ sar(scratch, kSmiTagSize); > - __ push(scratch); > + __ sar(number, kSmiTagSize); > + __ push(number); > __ fild_s(Operand(esp, 0)); > - __ pop(scratch); > + __ pop(number); > > __ bind(&done); > } > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "v8-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/v8-dev?hl=en -~----------~----~----~----~------~----~------~--~---
