Index: runtime/vm/flow_graph_optimizer.cc |
=================================================================== |
--- runtime/vm/flow_graph_optimizer.cc (revision 13286) |
+++ runtime/vm/flow_graph_optimizer.cc (working copy) |
@@ -148,7 +148,8 @@ |
if (join_entry->phis() != NULL) { |
for (intptr_t i = 0; i < join_entry->phis()->length(); ++i) { |
PhiInstr* phi = (*join_entry->phis())[i]; |
- if ((phi != NULL) && (phi->GetPropagatedCid() == kDoubleCid)) { |
+ if (phi == NULL) continue; |
+ if (phi->GetPropagatedCid() == kDoubleCid) { |
phi->set_representation(kUnboxedDouble); |
} |
} |
@@ -520,8 +521,17 @@ |
return false; |
} |
break; |
+ case Token::kSHR: |
+ if (HasOnlyTwoSmi(ic_data)) { |
Kevin Millikin (Google)
2012/10/05 12:52:58
Should really be ...TwoSmis.
Florian Schneider
2012/10/05 14:40:31
Done.
|
+ operands_type = kSmiCid; |
+ } else if (HasTwoMintOrSmi(ic_data) && |
+ FlowGraphCompiler::SupportsUnboxedMints()) { |
+ operands_type = kMintCid; |
+ } else { |
+ return false; |
+ } |
+ break; |
case Token::kTRUNCDIV: |
- case Token::kSHR: |
case Token::kSHL: |
if (HasOnlyTwoSmi(ic_data)) { |
operands_type = kSmiCid; |
@@ -554,9 +564,15 @@ |
} else if (operands_type == kMintCid) { |
Value* left = call->ArgumentAt(0)->value(); |
Value* right = call->ArgumentAt(1)->value(); |
- BinaryMintOpInstr* bin_op = |
- new BinaryMintOpInstr(op_kind, left, right, call); |
- call->ReplaceWith(bin_op, current_iterator()); |
+ if (op_kind == Token::kSHR) { |
+ ShiftMintOpInstr* shift_op = |
+ new ShiftMintOpInstr(op_kind, left, right, call); |
+ call->ReplaceWith(shift_op, current_iterator()); |
+ } else { |
+ BinaryMintOpInstr* bin_op = |
+ new BinaryMintOpInstr(op_kind, left, right, call); |
+ call->ReplaceWith(bin_op, current_iterator()); |
+ } |
RemovePushArguments(call); |
} else if (op_kind == Token::kMOD) { |
// TODO(vegorov): implement fast path code for modulo. |
@@ -2983,6 +2999,13 @@ |
} |
+void ConstantPropagator::VisitShiftMintOp( |
+ ShiftMintOpInstr* instr) { |
+ // TODO(kmillikin): Handle shift operations. |
+ SetValue(instr, non_constant_); |
+} |
+ |
+ |
void ConstantPropagator::VisitUnaryMintOp( |
UnaryMintOpInstr* instr) { |
// TODO(kmillikin): Handle unary operations. |