Chromium Code Reviews| Index: runtime/vm/flow_graph_optimizer.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_optimizer.cc (revision 14174) |
| +++ runtime/vm/flow_graph_optimizer.cc (working copy) |
| @@ -1251,33 +1251,43 @@ |
| static void HandleRelationalOp(FlowGraphOptimizer* optimizer, |
| RelationalOpInstr* comp, |
| Instruction* instr) { |
| - if (!comp->HasICData()) return; |
| - |
| + if (!comp->HasICData() || (comp->ic_data()->NumberOfChecks() == 0)) { |
| + return; |
| + } |
| const ICData& ic_data = *comp->ic_data(); |
| - if (ic_data.NumberOfChecks() == 0) return; |
| - // TODO(srdjan): Add multiple receiver type support. |
| - if (ic_data.NumberOfChecks() != 1) return; |
| - ASSERT(ic_data.HasOneTarget()); |
| - |
| - if (HasOnlyTwoSmis(ic_data)) { |
| - optimizer->InsertBefore( |
| - instr, |
| - new CheckSmiInstr(comp->left()->Copy(), comp->deopt_id()), |
| - instr->env(), |
| - Definition::kEffect); |
| - optimizer->InsertBefore( |
| - instr, |
| - new CheckSmiInstr(comp->right()->Copy(), comp->deopt_id()), |
| - instr->env(), |
| - Definition::kEffect); |
| - comp->set_operands_class_id(kSmiCid); |
| - } else if (ShouldSpecializeForDouble(ic_data)) { |
| - comp->set_operands_class_id(kDoubleCid); |
| + if (ic_data.NumberOfChecks() == 1) { |
| + ASSERT(ic_data.HasOneTarget()); |
| + if (HasOnlyTwoSmis(ic_data)) { |
| + optimizer->InsertBefore( |
| + instr, |
| + new CheckSmiInstr(comp->left()->Copy(), comp->deopt_id()), |
| + instr->env(), |
| + Definition::kEffect); |
| + optimizer->InsertBefore( |
| + instr, |
| + new CheckSmiInstr(comp->right()->Copy(), comp->deopt_id()), |
| + instr->env(), |
| + Definition::kEffect); |
| + comp->set_operands_class_id(kSmiCid); |
| + } else if (ShouldSpecializeForDouble(ic_data)) { |
| + comp->set_operands_class_id(kDoubleCid); |
| + } else if (HasTwoMintOrSmi(*comp->ic_data()) && |
| + FlowGraphCompiler::SupportsUnboxedMints()) { |
| + comp->set_operands_class_id(kMintCid); |
| + } else if (comp->ic_data()->AllReceiversAreNumbers()) { |
| + comp->set_operands_class_id(kNumberCid); |
|
srdjan
2012/10/29 19:30:25
What do we need the kNumberCid-s for (here and bel
Florian Schneider
2012/10/30 12:09:04
Removed. Actually not needed anymore.
|
| + } else { |
| + ASSERT(comp->operands_class_id() == kIllegalCid); |
| + } |
| + } else if (HasTwoMintOrSmi(*comp->ic_data()) && |
| + FlowGraphCompiler::SupportsUnboxedMints()) { |
| + comp->set_operands_class_id(kMintCid); |
| } else if (comp->ic_data()->AllReceiversAreNumbers()) { |
| comp->set_operands_class_id(kNumberCid); |
| } |
| } |
| + |
| void FlowGraphOptimizer::VisitRelationalOp(RelationalOpInstr* instr) { |
| HandleRelationalOp(this, instr, instr); |
| } |