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

Issue 149069: Changed RegExp parser to use a recursive data structure instead of stack-based recursion. (Closed)

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

Description

Changed RegExp parser to use a recursive data structure instead of stack-based recursion. Shouldn't run out of stack space while parsing deeply nested regexps. Might be a little faster.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Rewrote implementation of stored state to match one current disjunction and stored previous ones. #

Patch Set 3 : Removed static nonparticipating capture optimization. Not worth the complexity. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+155 lines, -135 lines) Patch
M src/ast.h View 2 chunks +1 line, -12 lines 0 comments Download
M src/parser.cc View 1 2 16 chunks +152 lines, -121 lines 2 comments Download
M test/cctest/test-regexp.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Lasse Reichstein
Please check for ugliness. It might need a little refactoring in some places to not ...
11 years, 6 months ago (2009-06-26 13:14:32 UTC) #1
Erik Corry
As discussed offline some of the loose variables that are passed by reference should be ...
11 years, 5 months ago (2009-06-29 09:22:30 UTC) #2
Lasse Reichstein
Rewrote to (somewhat like) what we discussed. Please recheck. I should remove the capture availability ...
11 years, 5 months ago (2009-06-30 07:31:08 UTC) #3
Erik Corry
11 years, 5 months ago (2009-07-01 11:29:14 UTC) #4
LGTM with comments if it lints.

http://codereview.chromium.org/149069/diff/3003/2006
File src/parser.cc (right):

http://codereview.chromium.org/149069/diff/3003/2006#newcode608
Line 608: struct RegExpParserState : public ZoneObject {
Please make this a real object.

http://codereview.chromium.org/149069/diff/3003/2006#newcode3863
Line 3863: RegExpParserState* stored_state = NULL;
If you initialize this to an initial stored state instead then you can have the
group_type live inside the stored state.  Also the disjunction_capture_index.

Powered by Google App Engine
This is Rietveld 408576698