Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index e48787b03856d7e24a6cd8e496f525d0bab94a29..d4f27dedf7ba1eaeef693abd703e0f6909843724 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -2110,9 +2110,10 @@ void DescriptorArray::Set(int descriptor_number, |
} |
-void DescriptorArray::Append(Descriptor* desc, |
- const WhitenessWitness& witness) { |
- int descriptor_number = NumberOfSetDescriptors(); |
+int DescriptorArray::Append(Descriptor* desc, |
+ const WhitenessWitness& witness, |
+ int number_of_set_descriptors) { |
+ int descriptor_number = number_of_set_descriptors; |
int enumeration_index = descriptor_number + 1; |
desc->SetEnumerationIndex(enumeration_index); |
@@ -2128,7 +2129,7 @@ void DescriptorArray::Append(Descriptor* desc, |
} |
Set(descriptor_number, desc, witness); |
- SetLastAdded(descriptor_number); |
+ return descriptor_number; |
} |
@@ -3554,6 +3555,14 @@ void Map::ClearDescriptorArray(Heap* heap, WriteBarrierMode mode) { |
} |
+void Map::AppendDescriptor(Descriptor* desc, |
+ const DescriptorArray::WhitenessWitness& witness) { |
+ DescriptorArray* descriptors = instance_descriptors(); |
+ int set_descriptors = descriptors->NumberOfSetDescriptors(); |
+ int new_last_added = descriptors->Append(desc, witness, set_descriptors); |
+ descriptors->SetLastAdded(new_last_added); |
+} |
+ |
Object* Map::GetBackPointer() { |
Object* object = READ_FIELD(this, kInstanceDescriptorsOrBackPointerOffset); |