| 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 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2716 int number_of_own_descriptors = map->NumberOfOwnDescriptors(); | 2716 int number_of_own_descriptors = map->NumberOfOwnDescriptors(); |
| 2717 if (number_of_own_descriptors == 0) { | 2717 if (number_of_own_descriptors == 0) { |
| 2718 DCHECK(descriptors == heap_->empty_descriptor_array()); | 2718 DCHECK(descriptors == heap_->empty_descriptor_array()); |
| 2719 return; | 2719 return; |
| 2720 } | 2720 } |
| 2721 | 2721 |
| 2722 int number_of_descriptors = descriptors->number_of_descriptors_storage(); | 2722 int number_of_descriptors = descriptors->number_of_descriptors_storage(); |
| 2723 int to_trim = number_of_descriptors - number_of_own_descriptors; | 2723 int to_trim = number_of_descriptors - number_of_own_descriptors; |
| 2724 if (to_trim > 0) { | 2724 if (to_trim > 0) { |
| 2725 heap_->RightTrimFixedArray(descriptors, | 2725 heap_->RightTrimFixedArray(descriptors, |
| 2726 to_trim * DescriptorArray::kDescriptorSize); | 2726 to_trim * DescriptorArray::kEntrySize); |
| 2727 descriptors->SetNumberOfDescriptors(number_of_own_descriptors); | 2727 descriptors->SetNumberOfDescriptors(number_of_own_descriptors); |
| 2728 | 2728 |
| 2729 if (descriptors->HasEnumCache()) TrimEnumCache(map, descriptors); | 2729 if (descriptors->HasEnumCache()) TrimEnumCache(map, descriptors); |
| 2730 descriptors->Sort(); | 2730 descriptors->Sort(); |
| 2731 | 2731 |
| 2732 if (FLAG_unbox_double_fields) { | 2732 if (FLAG_unbox_double_fields) { |
| 2733 LayoutDescriptor* layout_descriptor = map->layout_descriptor(); | 2733 LayoutDescriptor* layout_descriptor = map->layout_descriptor(); |
| 2734 layout_descriptor = layout_descriptor->Trim(heap_, map, descriptors, | 2734 layout_descriptor = layout_descriptor->Trim(heap_, map, descriptors, |
| 2735 number_of_own_descriptors); | 2735 number_of_own_descriptors); |
| 2736 SLOW_DCHECK(layout_descriptor->IsConsistentWithMap(map, true)); | 2736 SLOW_DCHECK(layout_descriptor->IsConsistentWithMap(map, true)); |
| (...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4055 // The target is always in old space, we don't have to record the slot in | 4055 // The target is always in old space, we don't have to record the slot in |
| 4056 // the old-to-new remembered set. | 4056 // the old-to-new remembered set. |
| 4057 DCHECK(!heap()->InNewSpace(target)); | 4057 DCHECK(!heap()->InNewSpace(target)); |
| 4058 RecordRelocSlot(host, &rinfo, target); | 4058 RecordRelocSlot(host, &rinfo, target); |
| 4059 } | 4059 } |
| 4060 } | 4060 } |
| 4061 } | 4061 } |
| 4062 | 4062 |
| 4063 } // namespace internal | 4063 } // namespace internal |
| 4064 } // namespace v8 | 4064 } // namespace v8 |
| OLD | NEW |