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

Issue 10911214: Split array loads/stores for growable arrays into two IL instructions. (Closed)

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

Description

Split array loads/stores for growable arrays into two IL instructions. This simplifies the code generation function for indexed loads/stores a lot and help eliminating the load of the backing store in the future. Enable CSE for loads of immutable fields like string length or fixed array length. Rename HasSideEffect into AffectedBySideEffect. Currently, only instructions that are not affected by side effects can participate in hoisting or redundancy elimination. Committed: https://code.google.com/p/dart/source/detail?r=12245

Patch Set 1 #

Total comments: 10

Patch Set 2 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -191 lines) Patch
M runtime/vm/flow_graph_optimizer.cc View 1 6 chunks +21 lines, -6 lines 0 comments Download
M runtime/vm/il_printer.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/intermediate_language.h View 1 13 chunks +22 lines, -26 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 1 chunk +10 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 chunk +19 lines, -78 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 chunk +19 lines, -80 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Florian Schneider
8 years, 3 months ago (2012-09-11 16:36:59 UTC) #1
srdjan
LGTM with comments & questions https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/flow_graph_optimizer.cc File runtime/vm/flow_graph_optimizer.cc (right): https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/flow_graph_optimizer.cc#newcode357 runtime/vm/flow_graph_optimizer.cc:357: AbstractType::ZoneHandle()); Add: elements->set_result_cid(kArrayCid); As ...
8 years, 3 months ago (2012-09-12 07:06:40 UTC) #2
Florian Schneider
8 years, 3 months ago (2012-09-12 08:27:29 UTC) #3
https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/flow_graph_...
File runtime/vm/flow_graph_optimizer.cc (right):

https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/flow_graph_...
runtime/vm/flow_graph_optimizer.cc:357: AbstractType::ZoneHandle());
On 2012/09/12 07:06:40, srdjan wrote:
> Add:
>     elements->set_result_cid(kArrayCid);
> 
> As type of elements use:
>    Type::ZoneHandle(Type::DynamicType())

Done.

https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/intermediat...
File runtime/vm/intermediate_language.cc (right):

https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language.cc:79: (immutable_ == other_load->immutable_));
On 2012/09/12 07:06:40, srdjan wrote:
> Also assert that result_cid is the same if offset is the same.

Done.

https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/intermediat...
File runtime/vm/intermediate_language.h (right):

https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language.h:2510: bool immutable = false)
On 2012/09/12 07:06:40, srdjan wrote:
> I think setting immutable_ via a setter (similar to set_result_cid) is better:
> no default arguments needed and better documentation at call site than passing
> true/false. Otherwise, please make immutable_const.

Done. Making it const for now.

https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/intermediat...
File runtime/vm/intermediate_language_ia32.cc (left):

https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language_ia32.cc:870: (receiver_type() ==
kImmutableArrayCid));
On 2012/09/12 07:06:40, srdjan wrote:
> Why is this assert removed? Shouldn't it check that type is either kArrayCid
or
> kImmutableArrayCid? MAybe the assert belongs to EmitNativeCode?

I removed receiver_type() from LoadIndexed completely since it is not needed
anymore.

https://chromiumcodereview.appspot.com/10911214/diff/1/runtime/vm/intermediat...
runtime/vm/intermediate_language_ia32.cc:916: (receiver_type() == kArrayCid));
On 2012/09/12 07:06:40, srdjan wrote:
> Why is this assert removed? Shouldn't we check for kArrayCid only?

I removed receiver_type() from StoreIndexed as well.

Powered by Google App Engine
This is Rietveld 408576698