Reviewers: Erik Corry, Mads Ager,

Message:
Quick review.

Description:
Irregexp-32 frame-align code uses a register. This is no longer
hard-coded to ebx.

Please review this at http://codereview.chromium.org/18653

Affected files:
   M src/regexp-macro-assembler-ia32.h
   M src/regexp-macro-assembler-ia32.cc


Index: src/regexp-macro-assembler-ia32.cc
diff --git a/src/regexp-macro-assembler-ia32.cc  
b/src/regexp-macro-assembler-ia32.cc
index  
a3998efa79850193f4afce42b7b4cafe9564c967..2580fd27bdadfb71e270f1d58b788d922e1f2f50
  
100644
--- a/src/regexp-macro-assembler-ia32.cc
+++ b/src/regexp-macro-assembler-ia32.cc
@@ -331,7 +331,7 @@ void  
RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase(
      __ 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 @@ Handle<Object>  
RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {

    __ 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 @@ Handle<Object>  
RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {

      __ 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 @@ Handle<Object>  
RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {

      // 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,7 +1169,7 @@ void RegExpMacroAssemblerIA32::CheckStackLimit() {
  }


-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
Index: src/regexp-macro-assembler-ia32.h
diff --git a/src/regexp-macro-assembler-ia32.h  
b/src/regexp-macro-assembler-ia32.h
index  
b69cf821b6fd981a0ff01af27f093d0cd8013157..dd74c655f779bc60592868be52c3126082000140
  
100644
--- a/src/regexp-macro-assembler-ia32.h
+++ b/src/regexp-macro-assembler-ia32.h
@@ -219,7 +219,9 @@ class RegExpMacroAssemblerIA32: public  
RegExpMacroAssembler {
    // 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to