Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index 933399e00f43bd62c65993cb1b820d0035aa2cc7..cac8ffb5129d8be2c3de037e88d6f28dfaa124b6 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -3014,6 +3014,20 @@ void MacroAssembler::AbortIfNotSmi(Register object) { |
} |
+void MacroAssembler::AbortIfNotFixedArray(Register object, Register scratch) { |
+ Label ok, fail; |
+ CheckMap(object, |
+ scratch, |
+ isolate()->factory()->fixed_array_map(), |
+ &fail, |
+ DONT_DO_SMI_CHECK); |
+ jmp(&ok); |
+ bind(&fail); |
+ Abort("Operand is not a fixed array"); |
+ bind(&ok); |
+} |
+ |
+ |
void MacroAssembler::AbortIfNotString(Register object) { |
STATIC_ASSERT(kSmiTag == 0); |
tst(object, Operand(kSmiTagMask)); |
@@ -3673,13 +3687,25 @@ void MacroAssembler::ClampDoubleToUint8(Register result_reg, |
void MacroAssembler::LoadInstanceDescriptors(Register map, |
- Register descriptors) { |
+ Register descriptors, |
+ Register scratch) { |
ldr(descriptors, |
- FieldMemOperand(map, Map::kInstanceDescriptorsOrBitField3Offset)); |
- Label not_smi; |
- JumpIfNotSmi(descriptors, ¬_smi); |
+ FieldMemOperand(map, Map::kInstanceDescriptorsOrBackPointerOffset)); |
+ |
+ Label ok, fail; |
+ CheckMap(descriptors, |
+ scratch, |
+ isolate()->factory()->fixed_array_map(), |
+ &fail, |
+ DONT_DO_SMI_CHECK); |
+ jmp(&ok); |
+ bind(&fail); |
mov(descriptors, Operand(FACTORY->empty_descriptor_array())); |
- bind(¬_smi); |
+ bind(&ok); |
+ |
+ if (emit_debug_code()) { |
+ AbortIfNotFixedArray(descriptors, scratch); |
+ } |
} |
@@ -3704,8 +3730,17 @@ void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) { |
// check for an enum cache. Leave the map in r2 for the subsequent |
// prototype load. |
ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); |
- ldr(r3, FieldMemOperand(r2, Map::kInstanceDescriptorsOrBitField3Offset)); |
- JumpIfSmi(r3, call_runtime); |
+ ldr(r3, FieldMemOperand(r2, Map::kInstanceDescriptorsOrBackPointerOffset)); |
+ |
+ CheckMap(r3, |
+ r7, |
+ isolate()->factory()->fixed_array_map(), |
+ call_runtime, |
+ DONT_DO_SMI_CHECK); |
+ |
+ if (emit_debug_code()) { |
+ AbortIfNotFixedArray(r3, r7); |
+ } |
// Check that there is an enum cache in the non-empty instance |
// descriptors (r3). This is the case if the next enumeration |