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

Issue 6533: * Added simplified Boyer-Moore-Horspool text search. (Closed)

Created:
12 years, 2 months ago by Lasse Reichstein
Modified:
9 years, 6 months ago
Reviewers:
Erik Corry
CC:
v8-dev
Visibility:
Public.

Description

KMP algorithm is still left in the source. If this change checks out to be faster, it should be removed.

Patch Set 1 #

Patch Set 2 : Included comments from review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -20 lines) Patch
M src/jsregexp.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/runtime.h View 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.cc View 1 4 chunks +80 lines, -17 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Lasse Reichstein
Small code-review. Added Boyer-Moore-Horspool.
12 years, 2 months ago (2008-10-07 11:56:45 UTC) #1
Erik Corry
12 years, 2 months ago (2008-10-07 12:32:40 UTC) #2
LGTM

http://codereview.chromium.org/6533/diff/1/3
File src/runtime.cc (right):

http://codereview.chromium.org/6533/diff/1/3#newcode1036
Line 1036: // Significant bits taken from that character to use in bad-character
'that' seems to be a dangling reference

http://codereview.chromium.org/6533/diff/1/3#newcode1056
Line 1056: SmartPointer<byte> bad_char_map(NewArray<byte>(kBMHBadCharCount));
May as well be static for speed!

http://codereview.chromium.org/6533/diff/1/3#newcode1062
Line 1062: for(int i = p < m ? m - p : 0; i < m - 1; i++) {
Single-character variable overload here!

http://codereview.chromium.org/6533/diff/1/3#newcode1063
Line 1063: pchar c = pattern[i];
if (sizeof(schar) == 1 && c > 255) return -1;

http://codereview.chromium.org/6533/diff/1/3#newcode1147
Line 1147: // For small searches, KMP is not worth the setup overhead.
KMP?

Powered by Google App Engine
This is Rietveld 408576698