Commit c1d0401b authored by ager@chromium.org's avatar ager@chromium.org

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
parent 225a6a82
......@@ -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);
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment