| Index: runtime/vm/flow_graph_optimizer.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_optimizer.cc (revision 15292)
|
| +++ runtime/vm/flow_graph_optimizer.cc (working copy)
|
| @@ -56,6 +56,13 @@
|
| VisitInstanceCall(call);
|
| }
|
| }
|
| + } else if (it.Current()->IsStrictCompare()) {
|
| + VisitStrictCompare(it.Current()->AsStrictCompare());
|
| + } else if (it.Current()->IsBranch()) {
|
| + ComparisonInstr* compare = it.Current()->AsBranch()->comparison();
|
| + if (compare->IsStrictCompare()) {
|
| + VisitStrictCompare(compare->AsStrictCompare());
|
| + }
|
| }
|
| }
|
| current_iterator_ = NULL;
|
| @@ -1512,6 +1519,27 @@
|
| }
|
|
|
|
|
| +static bool MayBeBoxableNumber(intptr_t cid) {
|
| + return (cid == kDynamicCid) ||
|
| + (cid == kMintCid) ||
|
| + (cid == kBigintCid) ||
|
| + (cid == kDoubleCid);
|
| +}
|
| +
|
| +
|
| +// Check if number check is not needed.
|
| +void FlowGraphOptimizer::VisitStrictCompare(StrictCompareInstr* instr) {
|
| + if (!instr->needs_number_check()) return;
|
| +
|
| + // If one of the input is not a boxable number (Mint, Double, Bigint), no
|
| + // need for number checks.
|
| + if (!MayBeBoxableNumber(instr->left()->ResultCid()) ||
|
| + !MayBeBoxableNumber(instr->right()->ResultCid())) {
|
| + instr->set_needs_number_check(false);
|
| + }
|
| +}
|
| +
|
| +
|
| // SminessPropagator ensures that CheckSmis are eliminated across phis.
|
| class SminessPropagator : public ValueObject {
|
| public:
|
|
|