Chromium Code Reviews| Index: runtime/vm/flow_graph_optimizer.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_optimizer.cc (revision 42103) |
| +++ runtime/vm/flow_graph_optimizer.cc (working copy) |
| @@ -8238,10 +8238,11 @@ |
| void ConstantPropagator::VisitLoadField(LoadFieldInstr* instr) { |
| + Value* instance = instr->instance(); |
| if ((instr->recognized_kind() == MethodRecognizer::kObjectArrayLength) && |
| - (instr->instance()->definition()->IsCreateArray())) { |
| + instance->definition()->OriginalDefinition()->IsCreateArray()) { |
| Value* num_elements = |
| - instr->instance()->definition()->AsCreateArray()->num_elements(); |
| + instance->definition()->AsCreateArray()->num_elements(); |
| if (num_elements->BindsToConstant() && |
|
Vyacheslav Egorov (Google)
2014/12/05 13:45:16
Maybe BindsToConstant/BoundConstant should also be
|
| num_elements->BoundConstant().IsSmi()) { |
| intptr_t length = Smi::Cast(num_elements->BoundConstant()).Value(); |
| @@ -8252,7 +8253,8 @@ |
| } |
| if (instr->IsImmutableLengthLoad()) { |
| - ConstantInstr* constant = instr->instance()->definition()->AsConstant(); |
| + ConstantInstr* constant = |
| + instance->definition()->OriginalDefinition()->AsConstant(); |
| if (constant != NULL) { |
| if (constant->value().IsString()) { |
| SetValue(instr, Smi::ZoneHandle(I, |