Index: runtime/vm/intermediate_language_x64.cc |
=================================================================== |
--- runtime/vm/intermediate_language_x64.cc (revision 30852) |
+++ runtime/vm/intermediate_language_x64.cc (working copy) |
@@ -1390,7 +1390,25 @@ |
if (!ok_is_fall_through) { |
__ jmp(&ok); |
} |
+ |
+ if (deopt == NULL) { |
+ ASSERT(!compiler->is_optimizing()); |
+ __ Bind(fail); |
+ |
+ __ CompareImmediate(FieldAddress(field_reg, Field::guarded_cid_offset()), |
+ Immediate(kDynamicCid), PP); |
+ __ j(EQUAL, &ok); |
+ |
+ __ pushq(field_reg); |
+ __ pushq(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()), PP); |
} |
@@ -1430,18 +1448,11 @@ |
__ j(EQUAL, &ok); |
__ CompareObject(value_reg, Object::null_object(), PP); |
} |
- |
- if (ok_is_fall_through) { |
- __ j(NOT_EQUAL, fail); |
- } else { |
- __ j(EQUAL, &ok); |
- } |
+ __ j(NOT_EQUAL, fail); |
} else { |
// Both value's and field's class id is known. |
if ((value_cid != field_cid) && (value_cid != nullability)) { |
- if (ok_is_fall_through) { |
- __ jmp(fail); |
- } |
+ __ jmp(fail); |
} else if (field_has_length && (value_cid == field_cid)) { |
ASSERT(value_cid_reg != kNoRegister); |
if ((field_cid == kArrayCid) || (field_cid == kImmutableArrayCid)) { |
@@ -1455,31 +1466,12 @@ |
} |
__ CompareImmediate( |
value_cid_reg, Immediate(Smi::RawValue(field_length)), PP); |
- if (ok_is_fall_through) { |
- __ j(NOT_EQUAL, fail); |
- } |
+ __ j(NOT_EQUAL, fail); |
} else { |
- // Nothing to emit. |
- ASSERT(!compiler->is_optimizing()); |
- return; |
+ UNREACHABLE(); |
} |
} |
} |
- |
- if (deopt == NULL) { |
- ASSERT(!compiler->is_optimizing()); |
- __ Bind(fail); |
- |
- __ CompareImmediate(FieldAddress(field_reg, Field::guarded_cid_offset()), |
- Immediate(kDynamicCid), PP); |
- __ j(EQUAL, &ok); |
- |
- __ pushq(field_reg); |
- __ pushq(value_reg); |
- __ CallRuntime(kUpdateFieldCidRuntimeEntry, 2); |
- __ Drop(2); // Drop the field and the value. |
- } |
- |
__ Bind(&ok); |
} |