From a5e55c4584a4bcaba5bdf6a7316eb838e01f2757 Mon Sep 17 00:00:00 2001 From: "erik.corry@gmail.com" Date: Wed, 4 Feb 2009 13:05:40 +0000 Subject: [PATCH] Fix the not-at-start optimization to trigger on the V8 regexp benchmark. Review URL: http://codereview.chromium.org/20040 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1225 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/jsregexp.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jsregexp.cc b/src/jsregexp.cc index c827063ef7..dadec3ba61 100644 --- a/src/jsregexp.cc +++ b/src/jsregexp.cc @@ -2418,7 +2418,7 @@ void ChoiceNode::GetQuickCheckDetails(QuickCheckDetails* details, RegExpCompiler* compiler, int characters_filled_in, bool not_at_start) { - not_at_start = not_at_start || not_at_start_; + not_at_start = (not_at_start || not_at_start_); int choice_count = alternatives_->length(); ASSERT(choice_count > 0); alternatives_->at(0).node()->GetQuickCheckDetails(details, @@ -3161,6 +3161,7 @@ void ChoiceNode::Emit(RegExpCompiler* compiler, Trace* trace) { new_trace.set_bound_checked_up_to(preload_characters); } new_trace.quick_check_performed()->Clear(); + if (not_at_start_) new_trace.set_at_start(Trace::FALSE); alt_gen->expects_preload = preload_is_current; bool generate_full_check_inline = false; if (FLAG_irregexp_optimization && @@ -3249,6 +3250,7 @@ void ChoiceNode::EmitOutOfLineContinuation(RegExpCompiler* compiler, Trace out_of_line_trace(*trace); out_of_line_trace.set_characters_preloaded(preload_characters); out_of_line_trace.set_quick_check_performed(&alt_gen->quick_check_details); + if (not_at_start_) out_of_line_trace.set_at_start(Trace::FALSE); ZoneList* guards = alternative.guards(); int guard_count = (guards == NULL) ? 0 : guards->length(); if (next_expects_preload) {