OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/heap/mark-compact.h" | 5 #include "src/heap/mark-compact.h" |
6 | 6 |
7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/base/sys-info.h" | 9 #include "src/base/sys-info.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2701 int number_of_own_descriptors = map->NumberOfOwnDescriptors(); | 2701 int number_of_own_descriptors = map->NumberOfOwnDescriptors(); |
2702 if (number_of_own_descriptors == 0) { | 2702 if (number_of_own_descriptors == 0) { |
2703 DCHECK(descriptors == heap_->empty_descriptor_array()); | 2703 DCHECK(descriptors == heap_->empty_descriptor_array()); |
2704 return; | 2704 return; |
2705 } | 2705 } |
2706 | 2706 |
2707 int number_of_descriptors = descriptors->number_of_descriptors_storage(); | 2707 int number_of_descriptors = descriptors->number_of_descriptors_storage(); |
2708 int to_trim = number_of_descriptors - number_of_own_descriptors; | 2708 int to_trim = number_of_descriptors - number_of_own_descriptors; |
2709 if (to_trim > 0) { | 2709 if (to_trim > 0) { |
2710 heap_->RightTrimFixedArray(descriptors, | 2710 heap_->RightTrimFixedArray(descriptors, |
2711 to_trim * DescriptorArray::kDescriptorSize); | 2711 to_trim * DescriptorArray::kEntrySize); |
2712 descriptors->SetNumberOfDescriptors(number_of_own_descriptors); | 2712 descriptors->SetNumberOfDescriptors(number_of_own_descriptors); |
2713 | 2713 |
2714 if (descriptors->HasEnumCache()) TrimEnumCache(map, descriptors); | 2714 if (descriptors->HasEnumCache()) TrimEnumCache(map, descriptors); |
2715 descriptors->Sort(); | 2715 descriptors->Sort(); |
2716 | 2716 |
2717 if (FLAG_unbox_double_fields) { | 2717 if (FLAG_unbox_double_fields) { |
2718 LayoutDescriptor* layout_descriptor = map->layout_descriptor(); | 2718 LayoutDescriptor* layout_descriptor = map->layout_descriptor(); |
2719 layout_descriptor = layout_descriptor->Trim(heap_, map, descriptors, | 2719 layout_descriptor = layout_descriptor->Trim(heap_, map, descriptors, |
2720 number_of_own_descriptors); | 2720 number_of_own_descriptors); |
2721 SLOW_DCHECK(layout_descriptor->IsConsistentWithMap(map, true)); | 2721 SLOW_DCHECK(layout_descriptor->IsConsistentWithMap(map, true)); |
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4040 // The target is always in old space, we don't have to record the slot in | 4040 // The target is always in old space, we don't have to record the slot in |
4041 // the old-to-new remembered set. | 4041 // the old-to-new remembered set. |
4042 DCHECK(!heap()->InNewSpace(target)); | 4042 DCHECK(!heap()->InNewSpace(target)); |
4043 RecordRelocSlot(host, &rinfo, target); | 4043 RecordRelocSlot(host, &rinfo, target); |
4044 } | 4044 } |
4045 } | 4045 } |
4046 } | 4046 } |
4047 | 4047 |
4048 } // namespace internal | 4048 } // namespace internal |
4049 } // namespace v8 | 4049 } // namespace v8 |
OLD | NEW |