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

Issue 1556019: Avoid unnecessary cloning of regexp answer (Closed)

Created:
10 years, 8 months ago by sandholm
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Adding boolean saveAnswer property of RegExpCache to avoid unnecessary cloning of the regexp answer object/array. Committed: http://code.google.com/p/v8/source/detail?r=4364

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Total comments: 4

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -30 lines) Patch
M src/regexp.js View 1 2 3 5 chunks +17 lines, -7 lines 2 comments Download
M src/string.js View 1 7 chunks +23 lines, -23 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
sandholm
10 years, 8 months ago (2010-04-07 17:55:07 UTC) #1
Lasse Reichstein
If I understand this correctly: - the first time we execute a regexp on an ...
10 years, 8 months ago (2010-04-07 20:38:43 UTC) #2
Erik Corry
http://codereview.chromium.org/1556019/diff/1/2 File src/regexp.js (right): http://codereview.chromium.org/1556019/diff/1/2#newcode181 src/regexp.js:181: s = ToString(string); Here we can execute arbitrary user ...
10 years, 8 months ago (2010-04-08 08:47:18 UTC) #3
Lasse Reichstein
http://codereview.chromium.org/1556019/diff/1/2 File src/regexp.js (right): http://codereview.chromium.org/1556019/diff/1/2#newcode181 src/regexp.js:181: s = ToString(string); Very good catch. A solution would ...
10 years, 8 months ago (2010-04-08 09:31:38 UTC) #4
sandholm
On 2010/04/08 09:31:38, Lasse Reichstein wrote: > http://codereview.chromium.org/1556019/diff/1/2 > File src/regexp.js (right): > > http://codereview.chromium.org/1556019/diff/1/2#newcode181 ...
10 years, 8 months ago (2010-04-08 10:24:09 UTC) #5
sandholm
Uploaded a patch set. Please have another look.
10 years, 8 months ago (2010-04-08 11:19:02 UTC) #6
Erik Corry
http://codereview.chromium.org/1556019/diff/7001/8001 File src/regexp.js (right): http://codereview.chromium.org/1556019/diff/7001/8001#newcode130 src/regexp.js:130: // hit in RegExpExec, StringMatch and StringSplit Add full ...
10 years, 8 months ago (2010-04-08 13:35:43 UTC) #7
sandholm
http://codereview.chromium.org/1556019/diff/7001/8001 File src/regexp.js (right): http://codereview.chromium.org/1556019/diff/7001/8001#newcode130 src/regexp.js:130: // hit in RegExpExec, StringMatch and StringSplit On 2010/04/08 ...
10 years, 8 months ago (2010-04-08 14:26:02 UTC) #8
Erik Corry
LGTM!
10 years, 8 months ago (2010-04-08 14:31:23 UTC) #9
Lasse Reichstein
10 years, 8 months ago (2010-04-08 14:50:52 UTC) #10
Too late-comments :(

http://codereview.chromium.org/1556019/diff/14001/15001
File src/regexp.js (right):

http://codereview.chromium.org/1556019/diff/14001/15001#newcode170
src/regexp.js:170: cache.answerSaved = false;
No need to set answerSaved here. Set it, unconditionally, to saveAnswer when
updating the cache values below.

Due to the call to ToString below, we can't trust the value set here to stick
anyway.

http://codereview.chromium.org/1556019/diff/14001/15001#newcode241
src/regexp.js:241: cache.answerSaved = true;
I.e., always set answerSaved to saveAnswer here.

Powered by Google App Engine
This is Rietveld 408576698