Chromium Code Reviews| Index: runtime/vm/flow_graph_optimizer.cc |
| diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc |
| index b9f6bd448cddce363f24ede44848f46bd9aa0e07..ef6b36f75c2b7be44b8e138b610ea8fd282c4945 100644 |
| --- a/runtime/vm/flow_graph_optimizer.cc |
| +++ b/runtime/vm/flow_graph_optimizer.cc |
| @@ -6324,9 +6324,20 @@ void ConstantPropagator::VisitBooleanNegate(BooleanNegateInstr* instr) { |
| void ConstantPropagator::VisitInstanceOf(InstanceOfInstr* instr) { |
| - const Object& value = instr->value()->definition()->constant_value(); |
| + const Definition* def = instr->value()->definition(); |
| + const Object& value = def->constant_value(); |
| if (IsNonConstant(value)) { |
| - SetValue(instr, non_constant_); |
| + const AbstractType& checked_type = instr->type(); |
| + Representation rep = def->representation(); |
| + if ((checked_type.IsFloat32x4Type() && (rep == kUnboxedFloat32x4)) || |
| + (checked_type.IsUint32x4Type() && (rep == kUnboxedUint32x4)) || |
| + (checked_type.IsDoubleType() && (rep == kUnboxedDouble)) || |
| + (checked_type.IsIntType() && (rep == kUnboxedMint))) { |
| + // The representation guarantees the type check to be true. |
|
Florian Schneider
2013/10/03 09:06:55
Maybe add an ASSERT that the compile-type of instr
Cutch
2013/11/06 23:04:43
Done.
|
| + SetValue(instr, instr->negate_result() ? Bool::False() : Bool::True()); |
| + } else { |
| + SetValue(instr, non_constant_); |
| + } |
| } else if (IsConstant(value)) { |
| // TODO(kmillikin): Handle instanceof on constants. |
| SetValue(instr, non_constant_); |