Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Unified Diff: src/ia32/debug-ia32.cc

Issue 2943002: Reimplement stack manipulations for LiveEdit (Closed)
Patch Set: follow codereview Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.cc ('k') | src/liveedit.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/debug-ia32.cc
diff --git a/src/ia32/debug-ia32.cc b/src/ia32/debug-ia32.cc
index 9b558bd90b5af27d8a97cbe085199916fad486a1..1dce441d8c618ee4e865094a3efc1da0765d2b40 100644
--- a/src/ia32/debug-ia32.cc
+++ b/src/ia32/debug-ia32.cc
@@ -254,25 +254,30 @@ void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
}
-// FrameDropper is a code replacement for a JavaScript frame with possibly
-// several frames above.
-// There is no calling conventions here, because it never actually gets called,
-// it only gets returned to.
-// Frame structure (conforms InternalFrame structure):
-// -- JSFunction
-// -- code
-// -- SMI maker
-// -- context
-// -- frame base
-void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
- // We do not know our frame height, but set esp based on ebp.
- __ lea(esp, Operand(ebp, -4 * kPointerSize));
+// See documentation in debug.h.
+void Debug::GenerateRestarterPatchLiveEdit(MacroAssembler* masm) {
+#ifdef DEBUG
+ int offset1 = masm->pc_offset();
+ __ nop();
+ int offset2 = masm->pc_offset();
+ ASSERT_EQ(offset2 - offset1, kFrameRestarterEntryOffset);
+#else
+ __ nop();
+#endif
- __ pop(edi); // function
+ ExternalReference restarted_frame_id =
+ ExternalReference(Debug_Address::RestartedFrameFp());
+
+ // Reset restarted_frame_id variable. It means that frame has
+ // actually restarted and has become a regular frame.
+ __ mov(Operand::StaticVariable(restarted_frame_id), Immediate(0));
- // Skip code self-reference and marker.
- __ add(Operand(esp), Immediate(2 * kPointerSize));
+ // Whatever the height the frame was, reset the stack pointer
+ // according to the base pointer.
+ __ lea(esp, Operand(ebp, -2 * kPointerSize));
+ // Read back registers value.
+ __ pop(edi); // function
__ pop(esi); // Context.
__ pop(ebp);
@@ -288,18 +293,9 @@ void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
#undef __
-void Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame,
- Handle<Code> code) {
- ASSERT(bottom_js_frame->is_java_script());
-
- Address fp = bottom_js_frame->fp();
- Memory::Object_at(fp - 4 * kPointerSize) =
- Memory::Object_at(fp - 2 * kPointerSize); // Move edi (function).
+const int Debug::kFrameRestarterEntryOffset = 1;
+const int Debug::kRestartedFrameHeight = 3;
- Memory::Object_at(fp - 3 * kPointerSize) = *code;
- Memory::Object_at(fp - 2 * kPointerSize) = Smi::FromInt(StackFrame::INTERNAL);
-}
-const int Debug::kFrameDropperFrameSize = 5;
#endif // ENABLE_DEBUGGER_SUPPORT
« no previous file with comments | « src/heap.cc ('k') | src/liveedit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698