Two small fixes for the Math.sin and Math.cos optimizations.

Review URL: http://codereview.chromium.org/125122

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2167 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ager@chromium.org 2009-06-15 12:55:48 +00:00
parent 225a6a82b0
commit c1d0401b3d
2 changed files with 3 additions and 6 deletions

View File

@ -3416,7 +3416,7 @@ void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) {
void CodeGenerator::GenerateFastMathOp(MathOp op, ZoneList<Expression*>* args) {
VirtualFrame::SpilledScope spilled_scope;
Load(args->at(0));
LoadAndSpill(args->at(0));
switch (op) {
case SIN:
__ CallRuntime(Runtime::kMath_sin, 1);

View File

@ -4995,11 +4995,8 @@ void CodeGenerator::GenerateFastMathOp(MathOp op, ZoneList<Expression*>* args) {
// Store the result in the allocated heap number.
__ fstp_d(FieldOperand(heap_number.reg(), HeapNumber::kValueOffset));
// Pop the extra copy of the argument.
frame_->Pop();
// Push the result on the frame.
frame_->Push(&heap_number);
heap_number.Unuse();
// Replace the extra copy of the argument with the result.
frame_->SetElementAt(0, &heap_number);
done.Jump();
call_runtime.Bind();