Reviewers: Lasse Reichstein,
Description:
Reverting 2635
Please review this at http://codereview.chromium.org/1940001/show
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/ia32/regexp-macro-assembler-ia32.h
M src/ia32/regexp-macro-assembler-ia32.cc
Index: src/ia32/regexp-macro-assembler-ia32.cc
===================================================================
--- src/ia32/regexp-macro-assembler-ia32.cc (revision 4568)
+++ src/ia32/regexp-macro-assembler-ia32.cc (working copy)
@@ -770,7 +770,7 @@
// Preempt-code
if (check_preempt_label_.is_linked()) {
- SafeCallTarget(&check_preempt_label_);
+ __ bind(&check_preempt_label_);
__ push(backtrack_stackpointer());
__ push(edi);
@@ -790,7 +790,7 @@
// Backtrack stack overflow code.
if (stack_overflow_label_.is_linked()) {
- SafeCallTarget(&stack_overflow_label_);
+ __ bind(&stack_overflow_label_);
// Reached if the backtrack-stack limit has been hit.
Label grow_failed;
@@ -1102,22 +1102,20 @@
void RegExpMacroAssemblerIA32::SafeCall(Label* to) {
- __ call(to);
+ Label return_to;
+ __ push(Immediate::CodeRelativeOffset(&return_to));
+ __ jmp(to);
+ __ bind(&return_to);
}
void RegExpMacroAssemblerIA32::SafeReturn() {
- __ add(Operand(esp, 0), Immediate(masm_->CodeObject()));
- __ ret(0);
+ __ pop(ebx);
+ __ add(Operand(ebx), Immediate(masm_->CodeObject()));
+ __ jmp(Operand(ebx));
}
-void RegExpMacroAssemblerIA32::SafeCallTarget(Label* name) {
- __ bind(name);
- __ sub(Operand(esp, 0), Immediate(masm_->CodeObject()));
-}
-
-
void RegExpMacroAssemblerIA32::Push(Register source) {
ASSERT(!source.is(backtrack_stackpointer()));
// Notice: This updates flags, unlike normal Push.
Index: src/ia32/regexp-macro-assembler-ia32.h
===================================================================
--- src/ia32/regexp-macro-assembler-ia32.h (revision 4568)
+++ src/ia32/regexp-macro-assembler-ia32.h (working copy)
@@ -173,8 +173,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.
inline void Push(Register source);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev