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

Issue 21450: Irregexp:... (Closed)

Created:
11 years, 10 months ago by Erik Corry
Modified:
9 years, 7 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Irregexp: * Fix UC16 character classes on ASCII subjects. * Fix sign problem in Irregexp interpreter. * Make passes over text nodes more readable. Committed: http://code.google.com/p/v8/source/detail?r=1304

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -112 lines) Patch
M src/bytecodes-irregexp.h View 1 chunk +4 lines, -1 line 0 comments Download
M src/jsregexp.h View 1 chunk +8 lines, -4 lines 0 comments Download
M src/jsregexp.cc View 10 chunks +148 lines, -107 lines 8 comments Download
M src/objects.h View 1 chunk +1 line, -0 lines 0 comments Download
M test/mjsunit/regexp-UC16.js View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Erik Corry
11 years, 10 months ago (2009-02-18 13:44:58 UTC) #1
Lasse Reichstein
LGTM. http://codereview.chromium.org/21450/diff/1/5 File src/jsregexp.cc (right): http://codereview.chromium.org/21450/diff/1/5#newcode2273 Line 2273: pos->determines_perfectly = false; Should this be set ...
11 years, 10 months ago (2009-02-18 15:20:44 UTC) #2
Erik Corry
11 years, 10 months ago (2009-02-18 16:04:24 UTC) #3
http://codereview.chromium.org/21450/diff/1/5
File src/jsregexp.cc (right):

http://codereview.chromium.org/21450/diff/1/5#newcode2273
Line 2273: pos->determines_perfectly = false;
On 2009/02/18 15:20:44, Lasse Reichstein wrote:
> Should this be set to false? If the remaining cases of a choice node are
> actually determined perfectly, we should match them.
> I.e., treat a cannot-match result as if it wasn't there at all.

Determines perfectly indicates that this particular character position has been
checked completely by the quick check.  The implication is that if we get past
the quick check then we don't need to look at this character position again.  So
'false' would be wrong here.

http://codereview.chromium.org/21450/diff/1/5#newcode2329
Line 2329: // succeed.
On 2009/02/18 15:20:44, Lasse Reichstein wrote:
> This comment should be changed to just "not yet handled".
> It would be fairly easy to normalize the character class representation to be
> non-negated and treat it like a positive class.

I don't think that char classes like [^\u0000-ac-\uffff] are common enough to
warrant spending time on, ever.

http://codereview.chromium.org/21450/diff/1/5#newcode2677
Line 2677: return quick_check->positions(offset)->determines_perfectly;
On 2009/02/18 15:20:44, Lasse Reichstein wrote:
> Just checking: If we find that a position determines the branch perfectly,
will
> the position always be tested? Or is it possible that, e.g., both the first
and
> second character perfectly determines the branch, and only the first is
actually
> checked?

See above.

http://codereview.chromium.org/21450/diff/1/5#newcode2722
Line 2722: int* checked_up_to) {
On 2009/02/18 15:20:44, Lasse Reichstein wrote:
> This function is one big glob of special cases.
> If the different passes has something in common, please refactor it to, e.g.,
a
> template function or pass objects with virtual methods or something else that
> avoids putting all the cases in one monolithic function.

I've refactored a little more.  It is now only 68 lines with 30 lines of
comments to explain what it is doing.  I feel that making it much smaller will
either cause code duplication or unnecessary abstraction boilerplace elsewhere.

Powered by Google App Engine
This is Rietveld 408576698