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

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

Issue 14885: Irregexp-ia32: Don't inline conditional backtracks. (Closed)
Patch Set: 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/regexp-macro-assembler-ia32.h ('k') | no next file » | 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 fe38075b4f010ac589051f6d030cc8ac992af986..d3415204c715483e39e1df66408bbce445f1159e 100644
--- a/src/regexp-macro-assembler-ia32.cc
+++ b/src/regexp-macro-assembler-ia32.cc
@@ -93,6 +93,7 @@ RegExpMacroAssemblerIA32::RegExpMacroAssemblerIA32(
entry_label_(),
start_label_(),
success_label_(),
+ backtrack_label_(),
exit_label_(),
self_(Heap::undefined_value()) {
__ jmp(&entry_label_); // We'll write the entry code later.
@@ -106,6 +107,7 @@ RegExpMacroAssemblerIA32::~RegExpMacroAssemblerIA32() {
entry_label_.Unuse();
start_label_.Unuse();
success_label_.Unuse();
+ backtrack_label_.Unuse();
exit_label_.Unuse();
check_preempt_label_.Unuse();
}
@@ -551,6 +553,12 @@ Handle<Object> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
__ pop(esi);
__ ret(0);
+ // Backtrack code (branch target for conditional backtracks).
+ if (backtrack_label_.is_linked()) {
+ __ bind(&backtrack_label_);
+ Backtrack();
+ }
+
// Preempt-code
if (check_preempt_label_.is_linked()) {
__ bind(&check_preempt_label_);
@@ -801,10 +809,7 @@ void RegExpMacroAssemblerIA32::BranchOrBacktrack(Condition condition,
return;
}
if (to == NULL) {
- Label skip;
- __ j(NegateCondition(condition), &skip);
- Backtrack();
- __ bind(&skip);
+ __ j(condition, &backtrack_label_);
return;
}
__ j(condition, to);
« no previous file with comments | « src/regexp-macro-assembler-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698