Chromium Code Reviews| Index: runtime/vm/intermediate_language.cc |
| =================================================================== |
| --- runtime/vm/intermediate_language.cc (revision 10775) |
| +++ runtime/vm/intermediate_language.cc (working copy) |
| @@ -321,6 +321,19 @@ |
| } |
| +bool Definition::SetPropagatedCid(intptr_t cid) { |
| + ASSERT(cid != 1); |
|
regis
2012/08/16 16:02:47
What does 1 mean?
srdjan
2012/08/16 18:00:56
Debugging remainder. Thanks for catching it
|
| + ASSERT(cid != kIllegalCid); |
| + if (propagated_cid_ == kIllegalCid) { |
| + // First setting, nothing has changed. |
| + propagated_cid_ = cid; |
| + return false; |
| + } |
| + bool has_changed = (propagated_cid_ != cid); |
| + propagated_cid_ = cid; |
| + return has_changed; |
| +} |
| + |
| RawAbstractType* BindInstr::CompileType() const { |
| ASSERT(!HasPropagatedType()); |
| // The compile type may be requested when building the flow graph, i.e. before |
| @@ -329,6 +342,14 @@ |
| } |
| +intptr_t BindInstr::GetPropagatedCid() { |
| + if (has_propagated_cid()) return propagated_cid(); |
| + intptr_t cid = computation()->ResultCid(); |
| + ASSERT(cid != kIllegalCid); |
| + SetPropagatedCid(cid); |
| + return cid; |
| +} |
| + |
| void BindInstr::RecordAssignedVars(BitVector* assigned_vars, |
| intptr_t fixed_parameter_count) { |
| computation()->RecordAssignedVars(assigned_vars, fixed_parameter_count); |
| @@ -568,6 +589,19 @@ |
| } |
| +intptr_t ConstantVal::ResultCid() const { |
| + if (value().IsNull()) { |
| + return kNullCid; |
| + } |
| + if (value().IsInstance()) { |
| + return Class::Handle(value().clazz()).id(); |
| + } else { |
| + ASSERT(value().IsAbstractTypeArguments()); |
| + return kDynamicCid; |
| + } |
| +} |
| + |
| + |
| RawAbstractType* UseVal::CompileType() const { |
| if (definition()->HasPropagatedType()) { |
| return definition()->PropagatedType(); |
| @@ -581,6 +615,11 @@ |
| } |
| +intptr_t UseVal::ResultCid() const { |
| + return definition()->GetPropagatedCid(); |
| +} |
| + |
| + |
| RawAbstractType* AssertAssignableComp::CompileType() const { |
| const AbstractType& value_compile_type = |
| AbstractType::Handle(value()->CompileType()); |