Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: src/ia32/codegen-ia32.cc

Issue 164061: Make sure use of eax in inlined sin and cos is safe. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698