Revision: 2635
Author: [email protected]
Date: Thu Aug  6 05:51:04 2009
Log: Irregexp-ia32 internal call strategy changed.

Review URL: http://codereview.chromium.org/164053

http://code.google.com/p/v8/source/detail?r=2635

Modified:
  /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.cc
  /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.h

=======================================
--- /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.cc     Thu Jul 
 
23 23:14:23 2009
+++ /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.cc     Thu  
Aug  6 05:51:04 2009
@@ -752,7 +752,7 @@

    // Preempt-code
    if (check_preempt_label_.is_linked()) {
-    __ bind(&check_preempt_label_);
+    SafeCallTarget(&check_preempt_label_);

      __ push(backtrack_stackpointer());
      __ push(edi);
@@ -772,7 +772,7 @@

    // Backtrack stack overflow code.
    if (stack_overflow_label_.is_linked()) {
-    __ bind(&stack_overflow_label_);
+    SafeCallTarget(&stack_overflow_label_);
      // Reached if the backtrack-stack limit has been hit.

      Label grow_failed;
@@ -1249,17 +1249,19 @@


  void RegExpMacroAssemblerIA32::SafeCall(Label* to) {
-  Label return_to;
-  __ push(Immediate::CodeRelativeOffset(&return_to));
-  __ jmp(to);
-  __ bind(&return_to);
+  __ call(to);
  }


  void RegExpMacroAssemblerIA32::SafeReturn() {
-  __ pop(ebx);
-  __ add(Operand(ebx), Immediate(masm_->CodeObject()));
-  __ jmp(Operand(ebx));
+  __ add(Operand(esp,0), Immediate(masm_->CodeObject()));
+  __ ret(0);
+}
+
+
+void RegExpMacroAssemblerIA32::SafeCallTarget(Label* name) {
+  __ bind(name);
+  __ sub(Operand(esp, 0), Immediate(masm_->CodeObject()));
  }


=======================================
--- /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.h      Mon May 
 
25 03:05:56 2009
+++ /branches/bleeding_edge/src/ia32/regexp-macro-assembler-ia32.h      Thu Aug 
  
6 05:51:04 2009
@@ -227,6 +227,7 @@
    // is GC-safe (i.e., doesn't leave absolute code addresses on the stack)
    inline void SafeCall(Label* to);
    inline void SafeReturn();
+  inline void SafeCallTarget(Label* name);

    // Pushes the value of a register on the backtrack stack. Decrements the
    // stack pointer (ecx) by a word size and stores the register's value  
there.

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

Reply via email to