Chromium Code Reviews| Index: runtime/vm/flow_graph_optimizer.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_optimizer.cc (revision 38317) |
| +++ runtime/vm/flow_graph_optimizer.cc (working copy) |
| @@ -2020,6 +2020,7 @@ |
| switch (op_kind) { |
| case Token::kADD: |
| case Token::kSUB: |
| + case Token::kMUL: |
| if (HasOnlyTwoOf(ic_data, kSmiCid)) { |
| // Don't generate smi code if the IC data is marked because |
| // of an overflow. |
| @@ -2037,28 +2038,28 @@ |
| } else if (HasOnlyTwoOf(ic_data, kFloat32x4Cid)) { |
| operands_type = kFloat32x4Cid; |
| } else if (HasOnlyTwoOf(ic_data, kInt32x4Cid)) { |
| + ASSERT(op_kind != Token::kMUL); |
| operands_type = kInt32x4Cid; |
| } else if (HasOnlyTwoOf(ic_data, kFloat64x2Cid)) { |
| operands_type = kFloat64x2Cid; |
| } else { |
| return false; |
| } |
| - break; |
| - case Token::kMUL: |
| - if (HasOnlyTwoOf(ic_data, kSmiCid)) { |
| - // Don't generate smi code if the IC data is marked because of an |
| - // overflow. |
| - // TODO(fschneider): Add unboxed mint multiplication. |
| - if (ic_data.HasDeoptReason(ICData::kDeoptBinarySmiOp)) return false; |
| - operands_type = kSmiCid; |
| - } else if (ShouldSpecializeForDouble(ic_data)) { |
| - operands_type = kDoubleCid; |
| - } else if (HasOnlyTwoOf(ic_data, kFloat32x4Cid)) { |
| - operands_type = kFloat32x4Cid; |
| - } else if (HasOnlyTwoOf(ic_data, kFloat64x2Cid)) { |
| - operands_type = kFloat64x2Cid; |
| - } else { |
| - return false; |
| + // The binary mint multiplication only supports uint32 as inputs. |
| + if ((operands_type == kMintCid) && (op_kind == Token::kMUL)) { |
| + ASSERT(call->ArgumentCount() == 2); |
| + Definition* left_input = call->ArgumentAt(0); |
| + Definition* right_input = call->ArgumentAt(1); |
| + ASSERT(left_input != NULL); |
| + ASSERT(right_input != NULL); |
| + Range* left_range = left_input->range(); |
| + Range* right_range = right_input->range(); |
| + if ((left_range == NULL) || |
|
Vyacheslav Egorov (Google)
2014/07/16 23:51:35
Unfortunately range information is not available a
regis
2014/07/18 02:44:57
You are right. I removed this range check.
|
| + !left_range->IsWithin(0, static_cast<int64_t>(kMaxUint32)) || |
| + (right_range == NULL) || |
| + !right_range->IsWithin(0, static_cast<int64_t>(kMaxUint32))) { |
| + return false; |
| + } |
| } |
| break; |
| case Token::kDIV: |