Chromium Code Reviews| Index: runtime/vm/intermediate_language.cc |
| =================================================================== |
| --- runtime/vm/intermediate_language.cc (revision 10748) |
| +++ runtime/vm/intermediate_language.cc (working copy) |
| @@ -568,6 +568,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 +594,21 @@ |
| } |
| +intptr_t UseVal::ResultCid() const { |
| + // Some definitions are not in the instruction list, and must have |
| + // its propagated cid computed at first use. |
| + if (!definition()->has_propagated_cid()) { |
| + intptr_t cid = kDynamicCid; |
| + if (definition()->IsBind()) { |
|
regis
2012/08/15 22:46:54
Why do you test for a Bind?
You should just forwar
srdjan
2012/08/16 00:34:46
Forwarding to function GetPropagatedCid() that may
|
| + cid = definition()->AsBind()->computation()->ResultCid(); |
| + ASSERT(cid != kIllegalCid); |
| + } |
| + definition()->SetPropagatedCid(cid); |
| + } |
| + return definition()->propagated_cid(); |
| +} |
| + |
| + |
| RawAbstractType* AssertAssignableComp::CompileType() const { |
| const AbstractType& value_compile_type = |
| AbstractType::Handle(value()->CompileType()); |