Index: src/ia32/regexp-macro-assembler-ia32.cc |
diff --git a/src/ia32/regexp-macro-assembler-ia32.cc b/src/ia32/regexp-macro-assembler-ia32.cc |
index 2aab7a8d943194c01d613a159446f8f59bf480a9..3d43a8b521ea56540f891480cbf9e3e14ee5785b 100644 |
--- a/src/ia32/regexp-macro-assembler-ia32.cc |
+++ b/src/ia32/regexp-macro-assembler-ia32.cc |
@@ -133,7 +133,6 @@ int RegExpMacroAssemblerIA32::stack_limit_slack() { |
void RegExpMacroAssemblerIA32::AdvanceCurrentPosition(int by) { |
if (by != 0) { |
- Label inside_string; |
__ add(Operand(edi), Immediate(by * char_size())); |
} |
} |
@@ -964,6 +963,17 @@ void RegExpMacroAssemblerIA32::ReadStackPointerFromRegister(int reg) { |
__ add(backtrack_stackpointer(), Operand(ebp, kStackHighEnd)); |
} |
+void RegExpMacroAssemblerIA32::SetCurrentPositionFromEnd(int by) { |
+ NearLabel after_position; |
+ __ cmp(edi, -by * char_size()); |
+ __ j(above_equal, &after_position); |
+ __ mov(edi, -by * char_size()); |
+ // On RegExp code entry (where this operation is used), the character before |
+ // the current position is expected to be already loaded. |
+ // We have advenced the position, so it's safe to read backwards. |
+ LoadCurrentCharacterUnchecked(-1, 1); |
+ __ bind(&after_position); |
+} |
void RegExpMacroAssemblerIA32::SetRegister(int register_index, int to) { |
ASSERT(register_index >= num_saved_registers_); // Reserved for positions! |