Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 1b0f2fa2d4fb196b3184ef9cf9e8ba8c6fe7ac82..6759b19a28868e5c3c0ce134aea8e6211531b3de 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -2920,19 +2920,36 @@ void MacroAssembler::LoadInstanceDescriptors(Register map, |
Register temp = descriptors; |
movq(temp, FieldOperand(map, Map::kTransitionsOrBackPointerOffset)); |
- Label ok, fail; |
+ Label ok, fail, load_from_back_pointer; |
CheckMap(temp, |
isolate()->factory()->fixed_array_map(), |
&fail, |
DONT_DO_SMI_CHECK); |
- movq(descriptors, FieldOperand(temp, TransitionArray::kDescriptorsOffset)); |
+ movq(temp, FieldOperand(temp, TransitionArray::kDescriptorsPointerOffset)); |
+ movq(descriptors, FieldOperand(temp, JSGlobalPropertyCell::kValueOffset)); |
jmp(&ok); |
+ |
bind(&fail); |
+ CompareRoot(temp, Heap::kUndefinedValueRootIndex); |
+ j(not_equal, &load_from_back_pointer, Label::kNear); |
Move(descriptors, isolate()->factory()->empty_descriptor_array()); |
+ jmp(&ok); |
+ |
+ bind(&load_from_back_pointer); |
+ movq(temp, FieldOperand(temp, Map::kTransitionsOrBackPointerOffset)); |
+ movq(temp, FieldOperand(temp, TransitionArray::kDescriptorsPointerOffset)); |
+ movq(descriptors, FieldOperand(temp, JSGlobalPropertyCell::kValueOffset)); |
+ |
bind(&ok); |
} |
+void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { |
+ movq(dst, FieldOperand(map, Map::kBitField3Offset)); |
+ DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); |
+} |
+ |
+ |
void MacroAssembler::EnumLength(Register dst, Register map) { |
STATIC_ASSERT(Map::EnumLengthBits::kShift == 0); |
movq(dst, FieldOperand(map, Map::kBitField3Offset)); |