Reviewers: Yang,
Message:
Hi Yang
I'm covering x64 here. I'm a bit sceptic about the quality of my asm code.
However, it works.
Peter
Description:
Fix issue 825 (LiveEdit vs. function with no locals) for x64.
Please review this at http://codereview.chromium.org/10387116/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/ia32/debug-ia32.cc
M src/x64/debug-x64.cc
Index: src/ia32/debug-ia32.cc
diff --git a/src/ia32/debug-ia32.cc b/src/ia32/debug-ia32.cc
index
901e38bfe3e33a855270d5ed107549a780291073..d153e18ee9ad24439766438954944cad296d7b9f
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.
Index: src/x64/debug-x64.cc
diff --git a/src/x64/debug-x64.cc b/src/x64/debug-x64.cc
index
94a50eb53e7731246dc135242ca92e889d975e90..6ef7e7befb737291f0f0c9466b1697a7f43646d5
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,18 @@ static void
Generate_DebugBreakCallHelper(MacroAssembler* masm,
{
FrameScope scope(masm, StackFrame::INTERNAL);
+ // Load padding words on stack.
+ __ movq(kScratchRegister,
+ Immediate(Debug::FramePaddingLayout::kPaddingValue));
+ __ Integer32ToSmi(kScratchRegister, kScratchRegister);
+ for (int i = 0; i < Debug::FramePaddingLayout::kInitialSize; i++) {
+ __ push(kScratchRegister);
+ }
+ __ movq(kScratchRegister,
+ Immediate(Debug::FramePaddingLayout::kInitialSize));
+ __ Integer32ToSmi(kScratchRegister, kScratchRegister);
+ __ push(kScratchRegister);
+
// 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 +171,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.
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev