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

Issue 17378: Capture register clearing on loop iteration (Closed)

Created:
11 years, 11 months ago by Christian Plesner Hansen
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Added clearing of captures before entering the body of a loop. This also revealed a bug or two that had to be fixed.

Patch Set 1 #

Total comments: 19
Unified diffs Side-by-side diffs Delta from patch set Stats (+326 lines, -91 lines) Patch
M src/ast.h View 8 chunks +18 lines, -10 lines 0 comments Download
M src/ast.cc View 1 chunk +34 lines, -0 lines 0 comments Download
M src/jsregexp.h View 5 chunks +53 lines, -14 lines 6 comments Download
M src/jsregexp.cc View 15 chunks +86 lines, -16 lines 9 comments Download
M src/regexp-macro-assembler.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/regexp-macro-assembler-ia32.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/regexp-macro-assembler-ia32.cc View 1 chunk +5 lines, -0 lines 2 comments Download
M src/regexp-macro-assembler-irregexp.h View 1 chunk +1 line, -0 lines 2 comments Download
M src/regexp-macro-assembler-irregexp.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/regexp-macro-assembler-tracer.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/regexp-macro-assembler-tracer.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M test/cctest/test-regexp.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/bugs/bug-176.js View 1 chunk +0 lines, -50 lines 0 comments Download
A test/mjsunit/bugs/bug-187.js View 1 chunk +30 lines, -0 lines 0 comments Download
M test/mjsunit/mjsunit.status View 1 chunk +4 lines, -0 lines 0 comments Download
A test/mjsunit/regexp-loop-capture.js View 1 chunk +30 lines, -0 lines 0 comments Download
A test/mjsunit/regress/regress-176.js View 1 chunk +50 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Christian Plesner Hansen
11 years, 11 months ago (2009-01-13 14:56:42 UTC) #1
Lasse Reichstein
(I have only looked at the ia32 code) http://codereview.chromium.org/17378/diff/1/6 File src/regexp-macro-assembler-ia32.cc (right): http://codereview.chromium.org/17378/diff/1/6#newcode932 Line 932: ...
11 years, 11 months ago (2009-01-14 08:38:34 UTC) #2
Erik Corry
LGTM http://codereview.chromium.org/17378/diff/1/4 File src/jsregexp.cc (right): http://codereview.chromium.org/17378/diff/1/4#newcode1378 Line 1378: assembler->PushRegister(reg, check_stack_limit); It's a waste to push... ...
11 years, 11 months ago (2009-01-14 09:24:31 UTC) #3
Erik Corry
in addition... http://codereview.chromium.org/17378/diff/1/4 File src/jsregexp.cc (right): http://codereview.chromium.org/17378/diff/1/4#newcode1389 Line 1389: if (affected_registers.Get(reg)) assembler->PopRegister(reg); On 2009/01/14 09:24:31, ...
11 years, 11 months ago (2009-01-14 09:30:13 UTC) #4
Christian Plesner Hansen
11 years, 11 months ago (2009-01-14 11:31:35 UTC) #5
http://codereview.chromium.org/17378/diff/1/4
File src/jsregexp.cc (right):

http://codereview.chromium.org/17378/diff/1/4#newcode1378
Line 1378: assembler->PushRegister(reg, check_stack_limit);
I'd like to defer that optimization.

http://codereview.chromium.org/17378/diff/1/4#newcode1428
Line 1428: case ActionNode::STORE_POSITION: {
Fixed

http://codereview.chromium.org/17378/diff/1/4#newcode1438
Line 1438: case ActionNode::CLEAR_CAPTURES: {
Fixed

http://codereview.chromium.org/17378/diff/1/5
File src/jsregexp.h (right):

http://codereview.chromium.org/17378/diff/1/5#newcode717
Line 717: RegExpNode* on_success);
Fixed

http://codereview.chromium.org/17378/diff/1/5#newcode764
Line 764: int range_from;
I thought so too but it turns out that you can't have union members that have a
constructor.

http://codereview.chromium.org/17378/diff/1/5#newcode1011
Line 1011: bool Mentions(int reg);
I'm not sure -- all other operations than the one I added use just one register
and it would make that code more cluttered to use intervals there.

http://codereview.chromium.org/17378/diff/1/6
File src/regexp-macro-assembler-ia32.cc (right):

http://codereview.chromium.org/17378/diff/1/6#newcode932
Line 932: __ mov(register_location(reg), esi);
Fixed

http://codereview.chromium.org/17378/diff/1/9
File src/regexp-macro-assembler-irregexp.h (right):

http://codereview.chromium.org/17378/diff/1/9#newcode69
Line 69: virtual void ClearRegister(int reg);
Good point.

Powered by Google App Engine
This is Rietveld 408576698