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

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

Issue 1118007: LiveEdit: implement frame dropping (Closed)
Patch Set: adding rule to mjsunit.status Created 10 years, 8 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/frames.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 5d18a0354e81639b39ff9c0ed394b03828eb5452..d142b11cf7b715d1d0039031e5a86ed3fd5ac181 100644
--- a/src/ia32/debug-ia32.cc
+++ b/src/ia32/debug-ia32.cc
@@ -206,8 +206,58 @@ void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) {
}
+void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
+ masm->ret(0);
+}
+
+// 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));
+
+ __ pop(edi); // function
+
+ // Skip code self-reference and marker.
+ __ add(Operand(esp), Immediate(2 * kPointerSize));
+
+ __ pop(esi); // Context.
+ __ pop(ebp);
+
+ // Get function code.
+ __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
+ __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset));
+ __ lea(edx, FieldOperand(edx, Code::kHeaderSize));
+
+ // Re-run JSFunction, edi is function, esi is context.
+ __ jmp(Operand(edx));
+}
+
#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).
+
+ 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
} } // namespace v8::internal
« no previous file with comments | « src/frames.cc ('k') | src/liveedit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698