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

Issue 9231017: Recursion limit for one-char string replace and retire String::kMinNonFlatLength. (Closed)

Created:
8 years, 11 months ago by Yang
Modified:
8 years, 11 months ago
Reviewers:
Erik Corry
CC:
v8-dev
Visibility:
Public.

Description

Recursion limit for one-char string replace and retire String::kMinNonFlatLength. TEST=mjsunit/string-replace-one-char.js Committed: https://code.google.com/p/v8/source/detail?r=10422

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -38 lines) Patch
M src/arm/code-stubs-arm.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/heap.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/mips/code-stubs-mips.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/objects.h View 1 chunk +0 lines, -3 lines 0 comments Download
M src/objects-debug.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/runtime.cc View 2 chunks +41 lines, -22 lines 5 comments Download
M src/string.js View 1 chunk +4 lines, -0 lines 1 comment Download
M src/x64/code-stubs-x64.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M test/cctest/test-strings.cc View 1 chunk +1 line, -1 line 0 comments Download
A test/mjsunit/string-replace-one-char.js View 1 chunk +92 lines, -0 lines 2 comments Download

Messages

Total messages: 4 (0 generated)
Yang
PTAL. http://codereview.chromium.org/9231017/diff/1/src/runtime.cc File src/runtime.cc (right): http://codereview.chromium.org/9231017/diff/1/src/runtime.cc#newcode3290 src/runtime.cc:3290: const int kRecursionLimit = 0x1000; Recursion limit is ...
8 years, 11 months ago (2012-01-17 13:07:34 UTC) #1
Erik Corry
LGTM http://codereview.chromium.org/9231017/diff/1/src/runtime.cc File src/runtime.cc (right): http://codereview.chromium.org/9231017/diff/1/src/runtime.cc#newcode3292 src/runtime.cc:3292: for (int i = 0; i < 2; ...
8 years, 11 months ago (2012-01-17 13:50:23 UTC) #2
Erik Corry
http://codereview.chromium.org/9231017/diff/1/src/runtime.cc File src/runtime.cc (right): http://codereview.chromium.org/9231017/diff/1/src/runtime.cc#newcode3300 src/runtime.cc:3300: if (!result.is_null()) return *result; Should you have a test ...
8 years, 11 months ago (2012-01-17 13:51:21 UTC) #3
Yang
8 years, 11 months ago (2012-01-17 14:29:04 UTC) #4
http://codereview.chromium.org/9231017/diff/1/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/9231017/diff/1/src/runtime.cc#newcode3292
src/runtime.cc:3292: for (int i = 0; i < 2; i++) {
On 2012/01/17 13:50:24, Erik Corry wrote:
> I think this would be clearer without the loop, just duplicating the call.

Done.

http://codereview.chromium.org/9231017/diff/1/src/runtime.cc#newcode3300
src/runtime.cc:3300: if (!result.is_null()) return *result;
On 2012/01/17 13:51:21, Erik Corry wrote:
> Should you have a test for found == false here and then return the original
> string?

Allocation is only ever done if found==true. In all other cases, either a
null-handle or the original subject string is returned, so there is no need for
an additional check.

http://codereview.chromium.org/9231017/diff/1/test/mjsunit/string-replace-one...
File test/mjsunit/string-replace-one-char.js (right):

http://codereview.chromium.org/9231017/diff/1/test/mjsunit/string-replace-one...
test/mjsunit/string-replace-one-char.js:39: "$", "###");
On 2012/01/17 13:50:24, Erik Corry wrote:
> It would be nice to test with a replacement string like "x$0x" to see that the
> '$' detection is working.

Done. I don't know what I was thinking.

Powered by Google App Engine
This is Rietveld 408576698