Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(924)

Unified Diff: src/regexp-macro-assembler-ia32.cc

Issue 13090: Irregexp-ia32: Fixed backref-matching (works, and advances current position). (Closed)
Patch Set: git diff master Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/jsregexp.cc ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp-macro-assembler-ia32.cc
diff --git a/src/regexp-macro-assembler-ia32.cc b/src/regexp-macro-assembler-ia32.cc
index e58323f11fce7e2f7686259677028c0f0304807c..76b4bcff5dd27a6e369c3e623d5710ce74371fd0 100644
--- a/src/regexp-macro-assembler-ia32.cc
+++ b/src/regexp-macro-assembler-ia32.cc
@@ -260,20 +260,27 @@ void RegExpMacroAssemblerIA32::CheckNotBackReference(
__ mov(eax, register_location(start_reg));
__ mov(ecx, register_location(start_reg + 1));
__ sub(ecx, Operand(eax)); // Length to check.
- __ j(less, on_no_match);
+ BranchOrBacktrack(less, on_no_match);
__ j(equal, &fallthrough);
- // check that there are sufficient characters left in the input
+ // Check that there are sufficient characters left in the input.
__ mov(ebx, edi);
__ add(ebx, Operand(ecx));
- __ j(greater, on_no_match);
- __ mov(ebx, Operand(edi));
- __ push(esi);
+ BranchOrBacktrack(greater, on_no_match);
+
+ __ mov(ebx, edi);
+ __ mov(edx, esi);
__ add(edi, Operand(esi));
__ add(esi, Operand(eax));
__ rep_cmpsb();
- __ pop(esi);
- __ mov(edi, Operand(ebx));
- BranchOrBacktrack(not_equal, on_no_match);
+ __ mov(esi, edx);
+ Label success;
+ __ j(equal, &success);
+ __ mov(edi, ebx);
+ BranchOrBacktrack(no_condition, on_no_match);
+
+ __ bind(&success);
+ __ sub(edi, Operand(esi));
+
__ bind(&fallthrough);
}
@@ -629,7 +636,6 @@ void RegExpMacroAssemblerIA32::CheckStackLimit() {
ExternalReference::address_of_stack_guard_limit();
__ cmp(esp, Operand::StaticVariable(stack_guard_limit));
__ j(above, &no_preempt, taken);
-
__ push(edi); // Current position.
__ push(edx); // Current character.
// Restore original edi, esi.
« no previous file with comments | « src/jsregexp.cc ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698