From 401fbbaef644cdc316c881f25a3bb42267639b02 Mon Sep 17 00:00:00 2001 From: "peter.rybin@gmail.com" Date: Wed, 16 May 2012 21:15:24 +0000 Subject: [PATCH] Fix issue 825 (LiveEdit vs. function with no locals) for x64. Review URL: https://chromiumcodereview.appspot.com/10387116 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11587 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ia32/debug-ia32.cc | 2 +- src/x64/debug-x64.cc | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ia32/debug-ia32.cc b/src/ia32/debug-ia32.cc index 901e38bfe3..d153e18ee9 100644 --- a/src/ia32/debug-ia32.cc +++ b/src/ia32/debug-ia32.cc @@ -175,7 +175,7 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm, // Read current padding counter and skip corresponding number of words. __ pop(unused_reg); // We divide stored value by 2 (untagging) and multiply it by word's size. - STATIC_ASSERT(kSmiTagSize == 1); + STATIC_ASSERT(kSmiTagSize == 1 && kSmiShiftSize == 0); __ lea(esp, Operand(esp, unused_reg, times_half_pointer_size, 0)); // Get rid of the internal frame. diff --git a/src/x64/debug-x64.cc b/src/x64/debug-x64.cc index 94a50eb53e..1b29e58d59 100644 --- a/src/x64/debug-x64.cc +++ b/src/x64/debug-x64.cc @@ -91,7 +91,7 @@ void BreakLocationIterator::ClearDebugBreakAtSlot() { rinfo()->PatchCode(original_rinfo()->pc(), Assembler::kDebugBreakSlotLength); } -const bool Debug::FramePaddingLayout::kIsSupported = false; +const bool Debug::FramePaddingLayout::kIsSupported = true; #define __ ACCESS_MASM(masm) @@ -105,6 +105,12 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm, { FrameScope scope(masm, StackFrame::INTERNAL); + // Load padding words on stack. + for (int i = 0; i < Debug::FramePaddingLayout::kInitialSize; i++) { + __ Push(Smi::FromInt(Debug::FramePaddingLayout::kPaddingValue)); + } + __ Push(Smi::FromInt(Debug::FramePaddingLayout::kInitialSize)); + // Store the registers containing live values on the expression stack to // make sure that these are correctly updated during GC. Non object values // are stored as as two smis causing it to be untouched by GC. @@ -159,6 +165,11 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm, } } + // Read current padding counter and skip corresponding number of words. + __ pop(kScratchRegister); + __ SmiToInteger32(kScratchRegister, kScratchRegister); + __ lea(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0)); + // Get rid of the internal frame. }