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

Issue 11416129: Inline [] operator on one-byte strings. (Closed)

Created:
8 years, 1 month ago by Florian Schneider
Modified:
8 years, 1 month ago
Reviewers:
srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Inline [] operator on one-byte strings. str[i] is translated into temp = str.charCodeAt(i) result = StringFromCharCode(temp); The existing code for charCodeAt is reused and contains the necessary range class id and range check. Committed: https://code.google.com/p/dart/source/detail?r=15246

Patch Set 1 #

Patch Set 2 : removed unnecessary change #

Total comments: 2

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+224 lines, -35 lines) Patch
M runtime/vm/constants_ia32.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/constants_x64.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_optimizer.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 2 3 3 chunks +57 lines, -32 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 2 3 3 chunks +33 lines, -1 line 0 comments Download
M runtime/vm/intermediate_language.cc View 1 2 3 1 chunk +10 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
M runtime/vm/symbols.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
A tests/language/optimized_string_charat_test.dart View 1 2 3 1 chunk +65 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Florian Schneider
8 years, 1 month ago (2012-11-21 14:36:55 UTC) #1
srdjan
LGTM https://codereview.chromium.org/11416129/diff/4002/runtime/vm/flow_graph_optimizer.cc File runtime/vm/flow_graph_optimizer.cc (right): https://codereview.chromium.org/11416129/diff/4002/runtime/vm/flow_graph_optimizer.cc#newcode1131 runtime/vm/flow_graph_optimizer.cc:1131: } Why not just return the value instead? ...
8 years, 1 month ago (2012-11-21 16:38:15 UTC) #2
srdjan
And please add a test for constant array and index. On 2012/11/21 16:38:15, srdjan wrote: ...
8 years, 1 month ago (2012-11-21 16:38:47 UTC) #3
Florian Schneider
8 years, 1 month ago (2012-11-22 11:05:58 UTC) #4
https://codereview.chromium.org/11416129/diff/4002/runtime/vm/flow_graph_opti...
File runtime/vm/flow_graph_optimizer.cc (right):

https://codereview.chromium.org/11416129/diff/4002/runtime/vm/flow_graph_opti...
runtime/vm/flow_graph_optimizer.cc:1131: }
On 2012/11/21 16:38:15, srdjan wrote:
> Why not just return the value instead? Is that handled somewhere else?

This helper builds the graph for charCodeAt, which is used two times below: in
for inlining charCodeAt and as a part of charAt. Also, I have not implemented
support for constant strings/constant indices yet, but added a TODO in the code
generator for now.

Powered by Google App Engine
This is Rietveld 408576698