Revision: 5256
Author: [email protected]
Date: Thu Aug 12 10:27:07 2010
Log: Reduce size of function restarter frame.

Review URL: http://codereview.chromium.org/3133007
http://code.google.com/p/v8/source/detail?r=5256

Modified:
 /branches/bleeding_edge/src/ia32/debug-ia32.cc

=======================================
--- /branches/bleeding_edge/src/ia32/debug-ia32.cc      Fri Jul 30 04:58:43 2010
+++ /branches/bleeding_edge/src/ia32/debug-ia32.cc      Thu Aug 12 10:27:07 2010
@@ -259,10 +259,9 @@
// 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
+//   -- function (slot is called "context")
 //   -- frame base
 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
   ExternalReference restarter_frame_function_slot =
@@ -270,16 +269,14 @@
__ mov(Operand::StaticVariable(restarter_frame_function_slot), Immediate(0));

   // 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.
+  __ lea(esp, Operand(ebp, -1 * kPointerSize));
+
+  __ pop(edi);  // Function.
   __ pop(ebp);

+  // Load context from the function.
+  __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
+
   // Get function code.
   __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
   __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset));
@@ -299,16 +296,19 @@
   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).
+
+  // Move function pointer into slot that is called referenced
+  // as StandardFrame::context()
+  Memory::Object_at(fp - 1 * kPointerSize) =
+      Memory::Object_at(fp - 2 * kPointerSize);

   Memory::Object_at(fp - 3 * kPointerSize) = *code;
Memory::Object_at(fp - 2 * kPointerSize) = Smi::FromInt(StackFrame::INTERNAL);

- return reinterpret_cast<Object**>(&Memory::Object_at(fp - 4 * kPointerSize)); + return reinterpret_cast<Object**>(&Memory::Object_at(fp - 1 * kPointerSize));
 }

-const int Debug::kFrameDropperFrameSize = 5;
+const int Debug::kFrameDropperFrameSize = 4;


 #endif  // ENABLE_DEBUGGER_SUPPORT

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

Reply via email to