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

Issue 6243008: Support StringCharCodeAt in hydrogen/lithium. (Closed)

Created:
9 years, 11 months ago by Vitaly Repeshko
Modified:
9 years, 7 months ago
Reviewers:
fschneider
CC:
v8-dev
Visibility:
Public.

Description

Support StringCharCodeAt in hydrogen/lithium. This patch adds H- and L-variants of StringCharCodeAt and StringLength. StringCharCodeAt is used to inline a constant function call of String.prototype.charCodeAt and to implement the corresponding inline runtime function. It does not yet use the recently introduced extra IC state. (We can specialize on string encoding and avoid deopts because of out of bounds accesses.) StringLength needs more work because the stub version of it also supports strings wrappers and it matters in some cases. (We have to separate the string only case.) Committed: http://code.google.com/p/v8/source/detail?r=6408

Patch Set 1 #

Patch Set 2 : Addressed Florian's comments. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+358 lines, -58 lines) Patch
M src/ast.cc View 4 chunks +9 lines, -17 lines 0 comments Download
M src/hydrogen.h View 2 chunks +6 lines, -1 line 0 comments Download
M src/hydrogen.cc View 10 chunks +88 lines, -37 lines 2 comments Download
M src/hydrogen-instructions.h View 1 5 chunks +65 lines, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 2 chunks +138 lines, -3 lines 0 comments Download
M src/ia32/lithium-ia32.h View 4 chunks +32 lines, -0 lines 2 comments Download
M src/ia32/lithium-ia32.cc View 1 1 chunk +14 lines, -0 lines 0 comments Download
M src/objects.h View 3 chunks +4 lines, -0 lines 0 comments Download
M src/objects-printer.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Vitaly Repeshko
9 years, 11 months ago (2011-01-19 01:00:17 UTC) #1
fschneider
LGTM. http://codereview.chromium.org/6243008/diff/3001/src/hydrogen.cc File src/hydrogen.cc (right): http://codereview.chromium.org/6243008/diff/3001/src/hydrogen.cc#newcode4156 src/hydrogen.cc:4156: if (!expr->target()->shared()->HasBuiltinFunctionId()) return false; Maybe we don't need ...
9 years, 11 months ago (2011-01-19 16:23:44 UTC) #2
Vitaly Repeshko
9 years, 11 months ago (2011-01-19 20:08:41 UTC) #3
http://codereview.chromium.org/6243008/diff/3001/src/hydrogen.cc
File src/hydrogen.cc (right):

http://codereview.chromium.org/6243008/diff/3001/src/hydrogen.cc#newcode4156
src/hydrogen.cc:4156: if (!expr->target()->shared()->HasBuiltinFunctionId())
return false;
On 2011/01/19 16:23:44, fschneider wrote:
> Maybe we don't need IsBuiltinMathFunction() anymore and can get rid of it.

Done.

http://codereview.chromium.org/6243008/diff/3001/src/ia32/lithium-ia32.h
File src/ia32/lithium-ia32.h (right):

http://codereview.chromium.org/6243008/diff/3001/src/ia32/lithium-ia32.h#newc...
src/ia32/lithium-ia32.h:1612: class LStringLength: public
LTemplateInstruction<1, 1> {
On 2011/01/19 16:23:44, fschneider wrote:
> For consistency I'd write 
> 
> public LTemplateInstruction<1, 1, 0>
> 
> (Probably I should remove the default T=0 template parameter for the number of
> temps.)
> 

Done.

Powered by Google App Engine
This is Rietveld 408576698