| Index: runtime/vm/intermediate_language_arm.cc
|
| diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
|
| index 01f1c1664ab4e22f4e2ea809613902dd19a9c48a..e5e60b880953795ccfe4fa0e714a15d493218fff 100644
|
| --- a/runtime/vm/intermediate_language_arm.cc
|
| +++ b/runtime/vm/intermediate_language_arm.cc
|
| @@ -1609,13 +1609,43 @@ void GuardFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| if ((field_cid == kArrayCid) || (field_cid == kImmutableArrayCid)) {
|
| __ ldr(temp_reg,
|
| FieldAddress(value_reg, Array::length_offset()));
|
| - __ CompareImmediate(temp_reg, field_length);
|
| + __ CompareImmediate(temp_reg, Smi::RawValue(field_length));
|
| } else if (RawObject::IsTypedDataClassId(field_cid)) {
|
| __ ldr(temp_reg,
|
| FieldAddress(value_reg, TypedData::length_offset()));
|
| - __ CompareImmediate(temp_reg, field_length);
|
| + __ CompareImmediate(temp_reg, Smi::RawValue(field_length));
|
| } else {
|
| ASSERT(field_cid == kIllegalCid);
|
| + Label check_array, local_exit, local_fail;
|
| + __ CompareImmediate(value_cid_reg, kNullCid);
|
| + __ b(&local_fail, EQ);
|
| + // Check for typed data array.
|
| + __ CompareImmediate(value_cid_reg, kTypedDataFloat32x4ArrayCid);
|
| + __ b(&local_fail, GT);
|
| + __ CompareImmediate(value_cid_reg, kTypedDataInt8ArrayCid);
|
| + __ b(&check_array, LT); // Could still be a regular array.
|
| + __ ldr(temp_reg,
|
| + FieldAddress(value_reg, TypedData::length_offset()));
|
| + __ ldr(IP, field_length_operand);
|
| + __ cmp(temp_reg, ShifterOperand(IP));
|
| + __ b(&local_exit); // Updated field length typed data array.
|
| + // Check for regular array.
|
| + __ Bind(&check_array);
|
| + __ CompareImmediate(value_cid_reg, kImmutableArrayCid);
|
| + __ b(&local_fail, GT);
|
| + __ CompareImmediate(value_cid_reg, kArrayCid);
|
| + __ b(&local_fail, LT);
|
| + __ ldr(temp_reg,
|
| + FieldAddress(value_reg, Array::length_offset()));
|
| + __ ldr(IP, field_length_operand);
|
| + __ cmp(temp_reg, ShifterOperand(IP));
|
| + __ b(&local_exit); // Updated field length from regular array.
|
| +
|
| + __ Bind(&local_fail);
|
| + __ LoadImmediate(IP, Smi::RawValue(Field::kNoFixedLength));
|
| + __ str(IP, field_length_operand);
|
| +
|
| + __ Bind(&local_exit);
|
| // Following branch cannot not occur, fall through.
|
| }
|
| __ b(fail, NE);
|
| @@ -1637,15 +1667,16 @@ void GuardFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| if ((field_cid == kArrayCid) || (field_cid == kImmutableArrayCid)) {
|
| __ ldr(temp_reg,
|
| FieldAddress(value_reg, Array::length_offset()));
|
| - __ CompareImmediate(temp_reg, field_length);
|
| + __ CompareImmediate(temp_reg, Smi::RawValue(field_length));
|
| } else if (RawObject::IsTypedDataClassId(field_cid)) {
|
| __ ldr(temp_reg,
|
| FieldAddress(value_reg, TypedData::length_offset()));
|
| - __ CompareImmediate(temp_reg, field_length);
|
| + __ CompareImmediate(temp_reg, Smi::RawValue(field_length));
|
| } else {
|
| ASSERT(field_cid == kIllegalCid);
|
| // Following jump cannot not occur, fall through.
|
| }
|
| + __ b(fail, NE);
|
| }
|
| // Not identical, possibly null.
|
| __ Bind(&skip_length_check);
|
| @@ -1686,7 +1717,7 @@ void GuardFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| __ b(&local_exit); // Updated field length from regular array.
|
|
|
| __ Bind(&local_fail);
|
| - __ LoadImmediate(IP, Field::kNoFixedLength);
|
| + __ LoadImmediate(IP, Smi::RawValue(Field::kNoFixedLength));
|
| __ str(IP, field_length_operand);
|
|
|
| __ Bind(&local_exit);
|
| @@ -1695,22 +1726,23 @@ void GuardFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| __ LoadImmediate(IP, value_cid);
|
| __ str(IP, field_cid_operand);
|
| __ str(IP, field_nullability_operand);
|
| - if ((value_cid == kArrayCid) || (value_cid == kImmutableArrayCid)) {
|
| - // Destroy value_cid_reg (safe because we are finished with it).
|
| - __ ldr(value_cid_reg,
|
| - FieldAddress(value_reg, Array::length_offset()));
|
| - __ str(value_cid_reg, field_length_operand);
|
| - } else if (RawObject::IsTypedDataClassId(value_cid)) {
|
| - // Destroy value_cid_reg (safe because we are finished with it).
|
| - __ ldr(value_cid_reg,
|
| - FieldAddress(value_reg, TypedData::length_offset()));
|
| - __ str(value_cid_reg, field_length_operand);
|
| - } else {
|
| - __ LoadImmediate(IP, Field::kNoFixedLength);
|
| - __ str(IP, field_length_operand);
|
| + if (field_has_length) {
|
| + if ((value_cid == kArrayCid) || (value_cid == kImmutableArrayCid)) {
|
| + // Destroy value_cid_reg (safe because we are finished with it).
|
| + __ ldr(value_cid_reg,
|
| + FieldAddress(value_reg, Array::length_offset()));
|
| + __ str(value_cid_reg, field_length_operand);
|
| + } else if (RawObject::IsTypedDataClassId(value_cid)) {
|
| + // Destroy value_cid_reg (safe because we are finished with it).
|
| + __ ldr(value_cid_reg,
|
| + FieldAddress(value_reg, TypedData::length_offset()));
|
| + __ str(value_cid_reg, field_length_operand);
|
| + } else {
|
| + __ LoadImmediate(IP, Smi::RawValue(Field::kNoFixedLength));
|
| + __ str(IP, field_length_operand);
|
| + }
|
| }
|
| }
|
| -
|
| if (!ok_is_fall_through) {
|
| __ b(&ok);
|
| }
|
|
|