Author: [email protected]
Date: Thu Jan 22 01:05:00 2009
New Revision: 1120
Modified:
branches/bleeding_edge/src/regexp-macro-assembler-ia32.cc
branches/bleeding_edge/src/regexp-macro-assembler-ia32.h
Log:
Irregexp-32 frame-align code uses a register. This is no longer hard-coded
to ebx.
Modified: branches/bleeding_edge/src/regexp-macro-assembler-ia32.cc
==============================================================================
--- branches/bleeding_edge/src/regexp-macro-assembler-ia32.cc (original)
+++ branches/bleeding_edge/src/regexp-macro-assembler-ia32.cc Thu Jan 22
01:05:00 2009
@@ -331,7 +331,7 @@
__ push(backtrack_stackpointer());
__ push(ebx);
const int four_arguments = 4;
- FrameAlign(four_arguments);
+ FrameAlign(four_arguments, ecx);
// Put arguments into allocated stack area.
__ mov(Operand(esp, 3 * kPointerSize), ebx);
__ mov(ecx, Operand(ebp, kInputEndOffset));
@@ -646,7 +646,7 @@
__ bind(&stack_limit_hit);
int num_arguments = 2;
- FrameAlign(num_arguments);
+ FrameAlign(num_arguments, ebx);
__ mov(Operand(esp, 1 * kPointerSize), Immediate(self_));
__ lea(eax, Operand(esp, -kPointerSize));
__ mov(Operand(esp, 0 * kPointerSize), eax);
@@ -769,7 +769,7 @@
__ bind(&retry);
int num_arguments = 2;
- FrameAlign(num_arguments);
+ FrameAlign(num_arguments, ebx);
__ mov(Operand(esp, 1 * kPointerSize), Immediate(self_));
__ lea(eax, Operand(esp, -kPointerSize));
__ mov(Operand(esp, 0 * kPointerSize), eax);
@@ -805,7 +805,7 @@
// Call GrowStack(backtrack_stackpointer())
int num_arguments = 1;
- FrameAlign(num_arguments);
+ FrameAlign(num_arguments, ebx);
__ mov(Operand(esp, 0), backtrack_stackpointer());
CallCFunction(FUNCTION_ADDR(&GrowStack), num_arguments);
// If return NULL, we have failed to grow the stack, and
@@ -1169,16 +1169,16 @@
}
-void RegExpMacroAssemblerIA32::FrameAlign(int num_arguments) {
+void RegExpMacroAssemblerIA32::FrameAlign(int num_arguments, Register
scratch) {
int frameAlignment = OS::ActivationFrameAlignment();
if (frameAlignment != 0) {
// Make stack end at alignment and make room for num_arguments words
// and the original value of esp.
- __ mov(ebx, esp);
+ __ mov(scratch, esp);
__ sub(Operand(esp), Immediate((num_arguments + 1) * kPointerSize));
ASSERT(IsPowerOf2(frameAlignment));
__ and_(esp, -frameAlignment);
- __ mov(Operand(esp, num_arguments * kPointerSize), ebx);
+ __ mov(Operand(esp, num_arguments * kPointerSize), scratch);
} else {
__ sub(Operand(esp), Immediate(num_arguments * kPointerSize));
}
Modified: branches/bleeding_edge/src/regexp-macro-assembler-ia32.h
==============================================================================
--- branches/bleeding_edge/src/regexp-macro-assembler-ia32.h (original)
+++ branches/bleeding_edge/src/regexp-macro-assembler-ia32.h Thu Jan 22
01:05:00 2009
@@ -219,7 +219,9 @@
// etc., not pushed. The argument count assumes all arguments are word
sized.
// Some compilers/platforms require the stack to be aligned when calling
// C++ code.
- inline void FrameAlign(int num_arguments);
+ // Needs a scratch register to do some arithmetic. This register will be
+ // trashed.
+ inline void FrameAlign(int num_arguments, Register scratch);
// Calls a C function and cleans up the space for arguments allocated
// by FrameAlign. The called function is not allowed to trigger a garbage
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---