| Index: runtime/vm/intermediate_language.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language.cc (revision 10825)
|
| +++ runtime/vm/intermediate_language.cc (working copy)
|
| @@ -351,6 +351,18 @@
|
| }
|
|
|
|
|
| +bool Definition::SetPropagatedCid(intptr_t cid) {
|
| + 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
|
| @@ -359,6 +371,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);
|
| @@ -598,6 +618,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();
|
| @@ -611,6 +644,11 @@
|
| }
|
|
|
|
|
| +intptr_t UseVal::ResultCid() const {
|
| + return definition()->GetPropagatedCid();
|
| +}
|
| +
|
| +
|
| RawAbstractType* AssertAssignableComp::CompileType() const {
|
| const AbstractType& value_compile_type =
|
| AbstractType::Handle(value()->CompileType());
|
|
|