Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index cda7549df5e24bc2b8ef53478101b2cb85ef1522..5053d6768a66cefd0a21d358cba1475cd17413f8 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -2853,11 +2853,21 @@ void MacroAssembler::ClampDoubleToUint8(XMMRegister input_reg, |
void MacroAssembler::LoadInstanceDescriptors(Register map, |
Register descriptors) { |
movq(descriptors, FieldOperand(map, |
- Map::kInstanceDescriptorsOrBitField3Offset)); |
- Label not_smi; |
- JumpIfNotSmi(descriptors, ¬_smi, Label::kNear); |
+ Map::kInstanceDescriptorsOrBackPointerOffset)); |
+ |
+ Label ok, fail; |
+ CheckMap(descriptors, |
+ isolate()->factory()->fixed_array_map(), |
+ &fail, |
+ DONT_DO_SMI_CHECK); |
+ jmp(&ok); |
+ bind(&fail); |
Move(descriptors, isolate()->factory()->empty_descriptor_array()); |
- bind(¬_smi); |
+ bind(&ok); |
+ |
+ if (emit_debug_code()) { |
+ AbortIfNotFixedArray(descriptors); |
+ } |
} |
@@ -2905,6 +2915,19 @@ void MacroAssembler::AbortIfNotSmi(const Operand& object) { |
} |
+void MacroAssembler::AbortIfNotFixedArray(Register object) { |
+ Label ok, fail; |
+ CheckMap(object, |
+ 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::AbortIfNotZeroExtended(Register int32_register) { |
ASSERT(!int32_register.is(kScratchRegister)); |
movq(kScratchRegister, 0x100000000l, RelocInfo::NONE); |
@@ -4457,8 +4480,16 @@ void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) { |
// check for an enum cache. Leave the map in rbx for the subsequent |
// prototype load. |
movq(rbx, FieldOperand(rcx, HeapObject::kMapOffset)); |
- movq(rdx, FieldOperand(rbx, Map::kInstanceDescriptorsOrBitField3Offset)); |
- JumpIfSmi(rdx, call_runtime); |
+ movq(rdx, FieldOperand(rbx, Map::kInstanceDescriptorsOrBackPointerOffset)); |
+ |
+ CheckMap(rdx, |
+ isolate()->factory()->fixed_array_map(), |
+ call_runtime, |
+ DONT_DO_SMI_CHECK); |
+ |
+ if (emit_debug_code()) { |
+ AbortIfNotFixedArray(rdx); |
+ } |
// Check that there is an enum cache in the non-empty instance |
// descriptors (rdx). This is the case if the next enumeration |