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

Issue 342015: Don't use string slices when processing RexExp replace (Closed)

Created:
11 years, 1 month ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
Reviewers:
Erik Corry
CC:
v8-dev
Visibility:
Public.

Description

Don't use string slices when processing RexExp replace. String slices from RegExp replace results is now encoded in either one or two smis. Substrings are not used any more. If the existing one smi encoding cannot hold the start/length information two smis are used the first having the negative length and the second having the start. This is in preparation for removing string slices. Committed: http://code.google.com/p/v8/source/detail?r=3153

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 8

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -12 lines) Patch
M src/runtime.cc View 1 2 3 4 chunks +42 lines, -9 lines 0 comments Download
M src/string.js View 1 2 3 2 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Thygesen Gjesse
11 years, 1 month ago (2009-10-28 08:02:15 UTC) #1
Erik Corry
LGTM with a few extra checks. http://codereview.chromium.org/342015/diff/4001/5001 File src/runtime.cc (right): http://codereview.chromium.org/342015/diff/4001/5001#newcode3806 Line 3806: // This ...
11 years, 1 month ago (2009-10-28 08:24:07 UTC) #2
Søren Thygesen Gjesse
11 years, 1 month ago (2009-10-28 08:53:32 UTC) #3
http://codereview.chromium.org/342015/diff/4001/5001
File src/runtime.cc (right):

http://codereview.chromium.org/342015/diff/4001/5001#newcode3806
Line 3806: // This assumpsion is used by the slice encoding in one or two smis.
On 2009/10/28 08:24:07, Erik Corry wrote:
> assumpsion -> assumption

Done.

http://codereview.chromium.org/342015/diff/4001/5001#newcode3849
Line 3849: i++;  // Skip position
On 2009/10/28 08:24:07, Erik Corry wrote:
> Needs to be checked for type/range.

Done.

http://codereview.chromium.org/342015/diff/4001/5002
File src/string.js (right):

http://codereview.chromium.org/342015/diff/4001/5002#newcode2
Line 2: // modification, are permitted provided that the following conditions
are
On 2009/10/28 08:24:07, Erik Corry wrote:
> This looks unintentional.

Reverted with 2008->2009

http://codereview.chromium.org/342015/diff/4001/5002#newcode812
Line 812: if (start >= 0 && len > 0 && start < 0x80000 && len < 0x800) {
On 2009/10/28 08:24:07, Erik Corry wrote:
> Start and len will never be < 0 so we should omit this test.

Done.

Powered by Google App Engine
This is Rietveld 408576698