Revision: 2618
Author: [email protected]
Date: Tue Aug  4 06:46:58 2009
Log: X64: Add missing pop when calling handler with Out-of-memory exception.
Review URL: http://codereview.chromium.org/160520
http://code.google.com/p/v8/source/detail?r=2618

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

=======================================
--- /branches/bleeding_edge/src/x64/codegen-x64.cc      Tue Aug  4 01:23:37 2009
+++ /branches/bleeding_edge/src/x64/codegen-x64.cc      Tue Aug  4 06:46:58 2009
@@ -6434,22 +6434,23 @@
    // Fetch top stack handler.
    ExternalReference handler_address(Top::k_handler_address);
    __ movq(kScratchRegister, handler_address);
-  __ movq(rdx, Operand(kScratchRegister, 0));
+  __ movq(rsp, Operand(kScratchRegister, 0));

    // Unwind the handlers until the ENTRY handler is found.
    Label loop, done;
    __ bind(&loop);
    // Load the type of the current stack handler.
-  __ cmpq(Operand(rdx, StackHandlerConstants::kStateOffset),
+  __ cmpq(Operand(rsp, StackHandlerConstants::kStateOffset),
           Immediate(StackHandler::ENTRY));
    __ j(equal, &done);
    // Fetch the next handler in the list.
-  __ movq(rdx, Operand(rdx, StackHandlerConstants::kNextOffset));
+  ASSERT(StackHandlerConstants::kNextOffset == 0);
+  __ pop(rsp);
    __ jmp(&loop);
    __ bind(&done);

    // Set the top handler address to next handler past the current ENTRY  
handler.
-  __ movq(rax, Operand(rdx, StackHandlerConstants::kNextOffset));
+  __ pop(rax);
    __ store_rax(handler_address);

    // Set external caught exception to false.
@@ -6462,14 +6463,12 @@
    ExternalReference pending_exception(Top::k_pending_exception_address);
    __ store_rax(pending_exception);

-  // Restore the stack to the address of the ENTRY handler
-  __ movq(rsp, rdx);
-
    // Clear the context pointer;
    __ xor_(rsi, rsi);

    // Restore registers from handler.
-
+  ASSERT_EQ(StackHandlerConstants::kNextOffset + kPointerSize,
+            StackHandlerConstants::kFPOffset);
    __ pop(rbp);  // FP
    ASSERT_EQ(StackHandlerConstants::kFPOffset + kPointerSize,
              StackHandlerConstants::kStateOffset);
=======================================
--- /branches/bleeding_edge/src/x64/disasm-x64.cc       Fri Jul 31 01:04:41 2009
+++ /branches/bleeding_edge/src/x64/disasm-x64.cc       Tue Aug  4 06:46:58 2009
@@ -88,7 +88,7 @@
    { 0x39, OPER_REG_OP_ORDER,      "cmp" },
    { 0x3A, BYTE_REG_OPER_OP_ORDER, "cmp" },
    { 0x3B, REG_OPER_OP_ORDER,      "cmp" },
-  { 0x8D, REG_OPER_OP_ORDER,      "lea" },
+  { 0x63, REG_OPER_OP_ORDER,      "movsxlq" },
    { 0x84, BYTE_REG_OPER_OP_ORDER, "test" },
    { 0x85, REG_OPER_OP_ORDER,      "test" },
    { 0x86, BYTE_REG_OPER_OP_ORDER, "xchg" },
@@ -97,6 +97,7 @@
    { 0x89, OPER_REG_OP_ORDER,      "mov" },
    { 0x8A, BYTE_REG_OPER_OP_ORDER, "mov" },
    { 0x8B, REG_OPER_OP_ORDER,      "mov" },
+  { 0x8D, REG_OPER_OP_ORDER,      "lea" },
    { -1, UNSET_OP_ORDER, "" }
  };


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

Reply via email to