Author: [EMAIL PROTECTED]
Date: Tue Oct 14 07:41:47 2008
New Revision: 500
Modified:
branches/bleeding_edge/src/codegen-ia32.cc
Log:
Move code (already reviewed) around in the source file and change a
few pop instructions that were missed before.
Review URL: http://codereview.chromium.org/7296
Modified: branches/bleeding_edge/src/codegen-ia32.cc
==============================================================================
--- branches/bleeding_edge/src/codegen-ia32.cc (original)
+++ branches/bleeding_edge/src/codegen-ia32.cc Tue Oct 14 07:41:47 2008
@@ -49,6 +49,37 @@
}
+void VirtualFrame::Enter() {
+ Comment cmnt(masm_, "[ Enter JS frame");
+ __ push(ebp);
+ __ mov(ebp, Operand(esp));
+
+ // Store the context and the function in the frame.
+ __ push(esi);
+ __ push(edi);
+
+ // Clear the function slot when generating debug code.
+ if (FLAG_debug_code) {
+ __ Set(edi, Immediate(reinterpret_cast<int>(kZapValue)));
+ }
+}
+
+
+void VirtualFrame::Exit() {
+ Comment cmnt(masm_, "[ Exit JS frame");
+ // Record the location of the JS exit code for patching when setting
+ // break point.
+ __ RecordJSReturn();
+
+ // Avoid using the leave instruction here, because it is too
+ // short. We need the return sequence to be a least the size of a
+ // call instruction to support patching the exit code in the
+ // debugger. See VisitReturnStatement for the full return sequence.
+ __ mov(esp, Operand(ebp));
+ __ pop(ebp);
+}
+
+
void VirtualFrame::AllocateLocals() {
if (frame_local_count_ > 0) {
Comment cmnt(masm_, "[ Allocate space for locals");
@@ -3671,37 +3702,6 @@
}
-void VirtualFrame::Enter() {
- Comment cmnt(masm_, "[ Enter JS frame");
- __ push(ebp);
- __ mov(ebp, Operand(esp));
-
- // Store the context and the function in the frame.
- __ push(esi);
- __ push(edi);
-
- // Clear the function slot when generating debug code.
- if (FLAG_debug_code) {
- __ Set(edi, Immediate(reinterpret_cast<int>(kZapValue)));
- }
-}
-
-
-void VirtualFrame::Exit() {
- Comment cmnt(masm_, "[ Exit JS frame");
- // Record the location of the JS exit code for patching when setting
- // break point.
- __ RecordJSReturn();
-
- // Avoid using the leave instruction here, because it is too
- // short. We need the return sequence to be a least the size of a
- // call instruction to support patching the exit code in the
- // debugger. See VisitReturnStatement for the full return sequence.
- __ mov(esp, Operand(ebp));
- __ pop(ebp);
-}
-
-
#undef __
#define __ masm->
@@ -3852,7 +3852,7 @@
// Variable::CONST because of const declarations which will
// initialize consts to 'the hole' value and by doing so, end up
// calling this code.
- __ pop(eax);
+ frame->Pop(eax);
__ mov(cgen_->SlotOperand(slot, ecx), eax);
frame->Push(eax); // RecordWrite may destroy the value in eax.
if (slot->type() == Slot::CONTEXT) {
@@ -3874,7 +3874,7 @@
Handle<String> name(GetName());
Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
// TODO(1222589): Make the IC grab the values from the stack.
- __ pop(eax);
+ frame->Pop(eax);
// Setup the name register.
__ mov(ecx, name);
__ call(ic, RelocInfo::CODE_TARGET);
@@ -3890,7 +3890,7 @@
// Call IC code.
Handle<Code>
ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
// TODO(1222589): Make the IC grab the values from the stack.
- __ pop(eax);
+ frame->Pop(eax);
__ call(ic, RelocInfo::CODE_TARGET);
frame->Push(eax); // IC call leaves result in eax, push it out
break;
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---