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

Issue 11348349: Improve array to string conversion. (Closed)

Created:
8 years ago by Yang
Modified:
8 years ago
Reviewers:
Toon Verwaest
CC:
v8-dev
Visibility:
Public.

Description

Improve array to string conversion. BUG=v8:2435 Committed: https://code.google.com/p/v8/source/detail?r=13144

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+623 lines, -132 lines) Patch
M src/arm/codegen-arm.cc View 1 chunk +42 lines, -0 lines 1 comment Download
M src/arm/full-codegen-arm.cc View 1 chunk +31 lines, -0 lines 0 comments Download
M src/arm/lithium-arm.h View 2 chunks +25 lines, -0 lines 0 comments Download
M src/arm/lithium-arm.cc View 1 chunk +10 lines, -0 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M src/codegen.h View 1 chunk +13 lines, -0 lines 0 comments Download
M src/hydrogen.cc View 1 chunk +31 lines, -0 lines 0 comments Download
M src/hydrogen-instructions.h View 2 chunks +28 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 chunk +43 lines, -0 lines 1 comment Download
M src/ia32/full-codegen-ia32.cc View 1 chunk +30 lines, -0 lines 1 comment Download
M src/ia32/lithium-codegen-ia32.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M src/ia32/lithium-ia32.h View 2 chunks +25 lines, -0 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 chunk +11 lines, -0 lines 0 comments Download
M src/json-stringifier.h View 1 chunk +1 line, -20 lines 1 comment Download
M src/objects.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects.cc View 1 chunk +24 lines, -0 lines 0 comments Download
M src/runtime.h View 5 chunks +8 lines, -5 lines 0 comments Download
M src/runtime.cc View 1 chunk +16 lines, -37 lines 0 comments Download
M src/string.js View 2 chunks +23 lines, -9 lines 1 comment Download
M src/uri.js View 3 chunks +57 lines, -29 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 chunk +40 lines, -0 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 chunk +30 lines, -0 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M src/x64/lithium-x64.h View 2 chunks +25 lines, -0 lines 0 comments Download
M src/x64/lithium-x64.cc View 1 chunk +11 lines, -0 lines 0 comments Download
M test/mjsunit/fuzz-natives-part1.js View 1 chunk +2 lines, -0 lines 0 comments Download
M test/mjsunit/fuzz-natives-part2.js View 1 chunk +7 lines, -1 line 0 comments Download
M test/mjsunit/fuzz-natives-part3.js View 1 chunk +7 lines, -1 line 0 comments Download
M test/mjsunit/fuzz-natives-part4.js View 1 chunk +7 lines, -1 line 0 comments Download
A + test/mjsunit/string-natives.js View 1 chunk +35 lines, -29 lines 0 comments Download
M test/mjsunit/uri.js View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Yang
Please take a look. I suggest starting with string.js and uri.js. %NewString and %TruncateString have ...
8 years ago (2012-12-03 13:08:51 UTC) #1
Toon Verwaest
8 years ago (2012-12-05 14:29:12 UTC) #2
lgtm with comments.

https://codereview.chromium.org/11348349/diff/1/src/arm/codegen-arm.cc
File src/arm/codegen-arm.cc (right):

https://codereview.chromium.org/11348349/diff/1/src/arm/codegen-arm.cc#newcod...
src/arm/codegen-arm.cc:561: __ strh(value, MemOperand(ip, index));
Please add a comment here as well to indicate that LSR 1 takes care of
smi-untag; and maybe a STATIC_ASSERT to document reliance on this fact.

https://codereview.chromium.org/11348349/diff/1/src/ia32/codegen-ia32.cc
File src/ia32/codegen-ia32.cc (right):

https://codereview.chromium.org/11348349/diff/1/src/ia32/codegen-ia32.cc#newc...
src/ia32/codegen-ia32.cc:833: __ mov_w(FieldOperand(string, index, times_1,
SeqString::kHeaderSize),
Can we add a comment that this works because of the Smi-tagging? Or at least a
STATIC_ASSERT that the tagbit is 0 and shifts by 1?

https://codereview.chromium.org/11348349/diff/1/src/ia32/full-codegen-ia32.cc
File src/ia32/full-codegen-ia32.cc (right):

https://codereview.chromium.org/11348349/diff/1/src/ia32/full-codegen-ia32.cc...
src/ia32/full-codegen-ia32.cc:3087: SeqStringSetCharGenerator::Generate(masm_,
true, eax, ebx, ecx);
Can we use an enum rather than bool to indicate two vs one?

https://codereview.chromium.org/11348349/diff/1/src/json-stringifier.h
File src/json-stringifier.h (right):

https://codereview.chromium.org/11348349/diff/1/src/json-stringifier.h#newcod...
src/json-stringifier.h:606:
SeqString::cast(*current_part_)->Truncate(current_index_);
Runtime_Truncate returns the resulting string; and does not support length == 0.
This function on the other hand does support length == 0; and relies on the
internal truncate that does not handle == 0. Can we just unify it all and
support length == 0 directly in the Truncate called here, and make it return the
new string? That way we can just support truncation to length == 0 in
Runtime_Truncate as well and don't need external checks. Then we can also remove
this utility function and just call truncate directly where you'd call
ShrinkCurrentPart.

https://codereview.chromium.org/11348349/diff/1/src/string.js
File src/string.js (right):

https://codereview.chromium.org/11348349/diff/1/src/string.js#newcode819
src/string.js:819: var one_byte = %NewString(n, true);
Can we have a javascript macro that indicates that this is "ONE_BYTE" vs
"TWO_BYTE"? That would be much more readable.

Powered by Google App Engine
This is Rietveld 408576698