Chromium Code Reviews| Index: runtime/vm/flow_graph_optimizer.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_optimizer.cc (revision 31039) |
| +++ runtime/vm/flow_graph_optimizer.cc (working copy) |
| @@ -96,12 +96,21 @@ |
| } |
| +static bool NoneIsDynamic(const GrowableArray<intptr_t>& cids) { |
| + for (intptr_t i = 0; i < cids.length(); i++) { |
| + if (cids[i] == kDynamicCid) { |
| + return false; |
| + } |
| + } |
| + return true; |
| +} |
| + |
| + |
| // Attempt to build ICData for call using propagated class-ids. |
| bool FlowGraphOptimizer::TryCreateICData(InstanceCallInstr* call) { |
| ASSERT(call->HasICData()); |
| if (call->ic_data()->NumberOfChecks() > 0) { |
| // This occurs when an instance call has too many checks. |
| - // TODO(srdjan): Replace IC call with megamorphic call. |
| return false; |
| } |
| GrowableArray<intptr_t> class_ids(call->ic_data()->num_args_tested()); |
| @@ -110,7 +119,7 @@ |
| intptr_t cid = call->PushArgumentAt(i)->value()->Type()->ToCid(); |
| class_ids.Add(cid); |
| } |
| - if (class_ids[0] != kDynamicCid) { |
| + if (NoneIsDynamic(class_ids)) { |
|
Florian Schneider
2013/12/11 10:41:08
I'd prefer naming this helper the opposite: e.g. O
srdjan
2013/12/11 21:54:59
Aggreed. However, decided to inline the loop and e
|
| ArgumentsDescriptor args_desc( |
| Array::Handle(ArgumentsDescriptor::New(call->ArgumentCount(), |
| call->argument_names()))); |
| @@ -6906,20 +6915,17 @@ |
| } |
| -void ConstantPropagator::VisitBinaryMintOp( |
| - BinaryMintOpInstr* instr) { |
| +void ConstantPropagator::VisitBinaryMintOp(BinaryMintOpInstr* instr) { |
| HandleBinaryOp(instr, instr->op_kind(), *instr->left(), *instr->right()); |
| } |
| -void ConstantPropagator::VisitShiftMintOp( |
| - ShiftMintOpInstr* instr) { |
| +void ConstantPropagator::VisitShiftMintOp(ShiftMintOpInstr* instr) { |
| HandleBinaryOp(instr, instr->op_kind(), *instr->left(), *instr->right()); |
| } |
| -void ConstantPropagator::VisitUnaryMintOp( |
| - UnaryMintOpInstr* instr) { |
| +void ConstantPropagator::VisitUnaryMintOp(UnaryMintOpInstr* instr) { |
| // TODO(kmillikin): Handle unary operations. |
| SetValue(instr, non_constant_); |
| } |