Revision: 2614
Author: [email protected]
Date: Tue Aug  4 01:23:37 2009
Log: X64: Fix bug in RandomPositiveSmi (doesn't save rsi before calling  
C-code).

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

http://code.google.com/p/v8/source/detail?r=2614

Modified:
  /branches/bleeding_edge/src/x64/codegen-x64.cc

=======================================
--- /branches/bleeding_edge/src/x64/codegen-x64.cc      Fri Jul 31 04:07:05 2009
+++ /branches/bleeding_edge/src/x64/codegen-x64.cc      Tue Aug  4 01:23:37 2009
@@ -3434,6 +3434,7 @@
  void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args)  
{
    ASSERT(args->length() == 0);
    frame_->SpillAll();
+  __ push(rsi);

    // Make sure the frame is aligned like the OS expects.
    static const int kFrameAlignment = OS::ActivationFrameAlignment();
@@ -3446,11 +3447,12 @@
    // Call V8::RandomPositiveSmi().
    __ Call(FUNCTION_ADDR(V8::RandomPositiveSmi), RelocInfo::RUNTIME_ENTRY);

-  // Restore stack pointer from callee-saved register edi.
+  // Restore stack pointer from callee-saved register.
    if (kFrameAlignment > 0) {
      __ movq(rsp, rbx);
    }

+  __ pop(rsi);
    Result result = allocator_->Allocate(rax);
    frame_->Push(&result);
  }
@@ -6806,6 +6808,7 @@

    __ bind(&done);
  }
+

  void FloatingPointHelper::LoadFloatOperands(MacroAssembler* masm,
                                              Register lhs,
@@ -6840,6 +6843,7 @@

    __ bind(&done);
  }
+

  void FloatingPointHelper::CheckFloatOperands(MacroAssembler* masm,
                                               Label* non_float) {
@@ -6877,6 +6881,7 @@
      default:         return "GenericBinaryOpStub";
    }
  }
+

  void GenericBinaryOpStub::GenerateSmiCode(MacroAssembler* masm, Label*  
slow) {
    // Perform fast-case smi code for the operation (rax <op> rbx) and
@@ -7018,7 +7023,6 @@

  void GenericBinaryOpStub::Generate(MacroAssembler* masm) {
    Label call_runtime;
-
    if (flags_ == SMI_CODE_IN_STUB) {
      // The fast case smi code wasn't inlined in the stub caller
      // code. Generate it here to speed up common operations.

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to