Index: runtime/vm/intermediate_language_arm.cc |
=================================================================== |
--- runtime/vm/intermediate_language_arm.cc (revision 30852) |
+++ runtime/vm/intermediate_language_arm.cc (working copy) |
@@ -1488,7 +1488,25 @@ |
if (!ok_is_fall_through) { |
__ b(&ok); |
} |
+ |
+ if (deopt == NULL) { |
+ ASSERT(!compiler->is_optimizing()); |
+ __ Bind(fail); |
+ |
+ __ ldr(IP, FieldAddress(field_reg, Field::guarded_cid_offset())); |
+ __ CompareImmediate(IP, kDynamicCid); |
+ __ b(&ok, EQ); |
+ |
+ __ Push(field_reg); |
+ __ Push(value_reg); |
+ __ CallRuntime(kUpdateFieldCidRuntimeEntry, 2); |
+ __ Drop(2); // Drop the field and the value. |
+ } |
} else { |
+ ASSERT(compiler->is_optimizing()); |
+ ASSERT(deopt != NULL); |
+ ASSERT(ok_is_fall_through); |
+ // Field guard class has been initialized and is known. |
if (field_reg != kNoRegister) { |
__ LoadObject(field_reg, Field::ZoneHandle(field().raw())); |
} |
@@ -1527,18 +1545,11 @@ |
__ CompareImmediate(value_reg, |
reinterpret_cast<intptr_t>(Object::null())); |
} |
- |
- if (ok_is_fall_through) { |
- __ b(fail, NE); |
- } else { |
- __ b(&ok, EQ); |
- } |
+ __ b(fail, NE); |
} else { |
// Both value's and field's class id is known. |
if ((value_cid != field_cid) && (value_cid != nullability)) { |
- if (ok_is_fall_through) { |
- __ b(fail); |
- } |
+ __ b(fail); |
} else if (field_has_length && (value_cid == field_cid)) { |
ASSERT(value_cid_reg != kNoRegister); |
if ((field_cid == kArrayCid) || (field_cid == kImmutableArrayCid)) { |
@@ -1551,31 +1562,12 @@ |
FieldAddress(value_reg, TypedData::length_offset())); |
} |
__ CompareImmediate(value_cid_reg, field_length); |
- if (ok_is_fall_through) { |
- __ b(fail, NE); |
- } |
+ __ b(fail, NE); |
} else { |
- // Nothing to emit. |
- ASSERT(!compiler->is_optimizing()); |
- return; |
+ UNREACHABLE(); |
} |
} |
} |
- |
- if (deopt == NULL) { |
- ASSERT(!compiler->is_optimizing()); |
- __ Bind(fail); |
- |
- __ ldr(IP, FieldAddress(field_reg, Field::guarded_cid_offset())); |
- __ CompareImmediate(IP, kDynamicCid); |
- __ b(&ok, EQ); |
- |
- __ Push(field_reg); |
- __ Push(value_reg); |
- __ CallRuntime(kUpdateFieldCidRuntimeEntry, 2); |
- __ Drop(2); // Drop the field and the value. |
- } |
- |
__ Bind(&ok); |
} |