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

Issue 442024: Perform string add in generated code on IA-32 platforms... (Closed)

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

Description

Perform string add in generated code on IA-32 platforms This adds a code stub which can do most of what Heap::AllocateConsString can do. It bails out if the result cannot fit in new space or if the result is a short (flat) string and one argument is an ascii string and the other a two byte string. It also bails out if adding two one character strings as Heap::AllocateConsString has special handling of this utilizing the symbol table. The stub is used both for the binary add operation and for StringAdd calls from runtime JavaScript files. Extended the string add test to cover all sizes of flat result stings. Committed: http://code.google.com/p/v8/source/detail?r=3400

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 14

Patch Set 3 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+492 lines, -18 lines) Patch
M src/arm/codegen-arm.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M src/arm/codegen-arm.cc View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M src/code-stubs.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/codegen.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/ia32/codegen-ia32.h View 1 2 2 chunks +34 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 2 3 chunks +233 lines, -2 lines 2 comments Download
M src/ia32/macro-assembler-ia32.h View 1 2 3 chunks +30 lines, -1 line 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 2 2 chunks +104 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.js View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M src/v8-counters.h View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M src/x64/codegen-x64.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M test/cctest/test-strings.cc View 2 chunks +32 lines, -8 lines 0 comments Download
M test/mjsunit/string-add.js View 1 2 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Søren Thygesen Gjesse
11 years ago (2009-11-27 07:03:56 UTC) #1
Mads Ager (chromium)
LGTM! Nice comments in the code generator. The code is easy to follow. http://codereview.chromium.org/442024/diff/2001/3002 File ...
11 years ago (2009-11-27 08:13:54 UTC) #2
Lasse Reichstein
http://codereview.chromium.org/442024/diff/2001/3002 File src/ia32/codegen-ia32.cc (right): http://codereview.chromium.org/442024/diff/2001/3002#newcode8365 src/ia32/codegen-ia32.cc:8365: void StringAddStub::GenerateCopyAsciiCharacters(MacroAssembler* masm, This seems inefficient at first, moving ...
11 years ago (2009-11-27 08:40:16 UTC) #3
Erik Corry
http://codereview.chromium.org/442024/diff/2001/3002 File src/ia32/codegen-ia32.cc (right): http://codereview.chromium.org/442024/diff/2001/3002#newcode8242 src/ia32/codegen-ia32.cc:8242: __ j(equal, &string_add_runtime); Did you check that this is ...
11 years ago (2009-11-27 14:29:57 UTC) #4
Søren Thygesen Gjesse
Added more tests in cctest/test-strings/ExternalShortStringAdd adding internal and external strings. http://codereview.chromium.org/442024/diff/2001/3002 File src/ia32/codegen-ia32.cc (right): http://codereview.chromium.org/442024/diff/2001/3002#newcode7059 ...
11 years ago (2009-12-03 07:48:41 UTC) #5
Erik Corry
11 years ago (2009-12-03 08:13:55 UTC) #6
LGTM.

I want it for ARM too!  (and 64 bit).

Would it be hard to call the string add code directly from the BinaryOpStub? 
Would it help?

http://codereview.chromium.org/442024/diff/7001/8002
File src/ia32/codegen-ia32.cc (right):

http://codereview.chromium.org/442024/diff/7001/8002#newcode8305
src/ia32/codegen-ia32.cc:8305: __ movzx_b(ecx, FieldOperand(ecx,
Map::kInstanceTypeOffset));
Here you load the type fields again that you just loaded in likes 8285 and 8290.
 Can you somehow rearrange the registers to avoid this?

http://codereview.chromium.org/442024/diff/7001/8002#newcode8341
src/ia32/codegen-ia32.cc:8341: __ movzx_b(ecx, FieldOperand(ecx,
Map::kInstanceTypeOffset));
Same issue here.

Powered by Google App Engine
This is Rietveld 408576698