| Index: runtime/vm/intermediate_language.cc
|
| diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
|
| index 177ba92198e491affb6f187b8f59b3f729787e62..b8423951c07f6b68378be728f2426b6d7492f38d 100644
|
| --- a/runtime/vm/intermediate_language.cc
|
| +++ b/runtime/vm/intermediate_language.cc
|
| @@ -497,6 +497,15 @@ void Value::RemoveFromUseList() {
|
| }
|
|
|
|
|
| +bool Definition::HasOnlyUse(Value* use) const {
|
| + if (((input_use_list() == use) && (env_use_list() == NULL)) ||
|
| + ((input_use_list() == NULL) && (env_use_list() == use))) {
|
| + return (use->next_use() == NULL);
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +
|
| void Definition::ReplaceUsesWith(Definition* other) {
|
| ASSERT(other != NULL);
|
| ASSERT(this != other);
|
| @@ -1163,6 +1172,11 @@ bool LoadFieldInstr::IsFixedLengthArrayCid(intptr_t cid) {
|
| }
|
|
|
|
|
| +Definition* ConstantInstr::Canonicalize(FlowGraphOptimizer* optimizer) {
|
| + return HasUses() ? this : NULL;
|
| +}
|
| +
|
| +
|
| Definition* LoadFieldInstr::Canonicalize(FlowGraphOptimizer* optimizer) {
|
| if (!IsImmutableLengthLoad()) return this;
|
|
|
|
|