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

Issue 12088108: Separate the array/string .length load from the bounds check. (Closed)

Created:
7 years, 10 months ago by Florian Schneider
Modified:
7 years, 10 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Separate the array/string .length load from the bounds check. This is done in preparation to inline more array and array view operations. Since the length is immutable for fixed length arrays, it allows hoisting the load out of loops. Committed: https://code.google.com/p/dart/source/detail?r=17984

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -123 lines) Patch
M runtime/vm/flow_graph_optimizer.cc View 7 chunks +42 lines, -89 lines 2 comments Download
M runtime/vm/intermediate_language.h View 3 chunks +10 lines, -4 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 2 chunks +59 lines, -3 lines 2 comments Download
M runtime/vm/intermediate_language_ia32.cc View 2 chunks +8 lines, -13 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 2 chunks +8 lines, -14 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Florian Schneider
7 years, 10 months ago (2013-02-01 12:21:38 UTC) #1
Vyacheslav Egorov (Google)
lgtm
7 years, 10 months ago (2013-02-01 14:44:30 UTC) #2
srdjan
DBC https://codereview.chromium.org/12088108/diff/1/runtime/vm/flow_graph_optimizer.cc File runtime/vm/flow_graph_optimizer.cc (right): https://codereview.chromium.org/12088108/diff/1/runtime/vm/flow_graph_optimizer.cc#newcode555 runtime/vm/flow_graph_optimizer.cc:555: const bool is_immutable = (class_id != kGrowableObjectArrayCid); It ...
7 years, 10 months ago (2013-02-01 19:01:28 UTC) #3
Florian Schneider
7 years, 10 months ago (2013-02-06 13:08:19 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/12088108/diff/1/runtime/vm/flow_graph_optimiz...
File runtime/vm/flow_graph_optimizer.cc (right):

https://codereview.chromium.org/12088108/diff/1/runtime/vm/flow_graph_optimiz...
runtime/vm/flow_graph_optimizer.cc:555: const bool is_immutable = (class_id !=
kGrowableObjectArrayCid);
On 2013/02/01 19:01:28, srdjan wrote:
> It may be better to compute is_immutable by checking what class_id IS and not
> what it IS NOT, since that could cause problems when adding new types in
> TryReplaceWithStoreIndexed.

Agree. I'll change it.

https://codereview.chromium.org/12088108/diff/1/runtime/vm/intermediate_langu...
File runtime/vm/intermediate_language.cc (right):

https://codereview.chromium.org/12088108/diff/1/runtime/vm/intermediate_langu...
runtime/vm/intermediate_language.cc:1672: case
MethodRecognizer::kStringBaseLength:
On 2013/02/01 19:01:28, srdjan wrote:
> Why not add the byte arrays as well?

Byte arrays are handled by kByteArrayBaseLength above.

Powered by Google App Engine
This is Rietveld 408576698