Review URL: http://codereview.chromium.org/125122
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2167
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
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);
// 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();