Chromium Code Reviews| Index: runtime/vm/flow_graph_optimizer.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_optimizer.cc (revision 20492) |
| +++ runtime/vm/flow_graph_optimizer.cc (working copy) |
| @@ -87,10 +87,17 @@ |
| ASSERT(call->ic_data()->num_args_tested() <= call->ArgumentCount()); |
| for (intptr_t i = 0; i < call->ic_data()->num_args_tested(); i++) { |
| intptr_t cid = call->PushArgumentAt(i)->value()->Type()->ToCid(); |
| + if (cid == kDynamicCid) { |
|
Vyacheslav Egorov (Google)
2013/03/26 18:56:13
How about a bit different approach:
In Definition
srdjan
2013/03/26 20:34:52
Yes, update the type in ReplaceUsesWith. In order
|
| + // Definition's type may differ from value's type as it may have been |
| + // changed by guarded_cid of an inlined LoadField. |
| + cid = call->PushArgumentAt(i)->value()->definition()->Type()->ToCid(); |
| + } |
| class_ids.Add(cid); |
| } |
| - // TODO(srdjan): Test for other class_ids > 1. |
| - if (class_ids.length() != 1) return false; |
| + // TODO(srdjan): Test for number of arguments checked greater than 1. |
| + if (class_ids.length() != 1) { |
| + return false; |
| + } |
| if (class_ids[0] != kDynamicCid) { |
| const intptr_t num_named_arguments = call->argument_names().IsNull() ? |
| 0 : call->argument_names().Length(); |