Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 647e2861c6b5c7505d41b9af21504e80f3aea2bc..8ee3656b23841f03c2721cf89878a25239cea87f 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -7643,11 +7643,12 @@ static void TrimDescriptorArray(Heap* heap, |
Map* map, |
DescriptorArray* descriptors, |
int number_of_own_descriptors) { |
- int number_of_descriptors = descriptors->number_of_descriptors(); |
+ int number_of_descriptors = descriptors->number_of_descriptors_storage(); |
int to_trim = number_of_descriptors - number_of_own_descriptors; |
- if (to_trim <= 0) return; |
+ if (to_trim == 0) return; |
- RightTrimFixedArray<FROM_GC>(heap, descriptors, to_trim); |
+ RightTrimFixedArray<FROM_GC>( |
+ heap, descriptors, to_trim * DescriptorArray::kDescriptorSize); |
descriptors->SetNumberOfDescriptors(number_of_own_descriptors); |
if (descriptors->HasEnumCache()) TrimEnumCache(heap, map, descriptors); |