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/v8.h" | 5 #include "src/v8.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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
(...skipping 2792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2803 int size, AllocationSpace dest) { | 2803 int size, AllocationSpace dest) { |
2804 Address dst_addr = dst->address(); | 2804 Address dst_addr = dst->address(); |
2805 Address src_addr = src->address(); | 2805 Address src_addr = src->address(); |
2806 DCHECK(heap()->AllowedToBeMigrated(src, dest)); | 2806 DCHECK(heap()->AllowedToBeMigrated(src, dest)); |
2807 DCHECK(dest != LO_SPACE && size <= Page::kMaxRegularHeapObjectSize); | 2807 DCHECK(dest != LO_SPACE && size <= Page::kMaxRegularHeapObjectSize); |
2808 if (dest == OLD_POINTER_SPACE) { | 2808 if (dest == OLD_POINTER_SPACE) { |
2809 Address src_slot = src_addr; | 2809 Address src_slot = src_addr; |
2810 Address dst_slot = dst_addr; | 2810 Address dst_slot = dst_addr; |
2811 DCHECK(IsAligned(size, kPointerSize)); | 2811 DCHECK(IsAligned(size, kPointerSize)); |
2812 | 2812 |
| 2813 bool may_contain_raw_values = src->MayContainRawValues(); |
| 2814 #if V8_DOUBLE_FIELDS_UNBOXING |
| 2815 InobjectPropertiesHelper helper(src->map()); |
| 2816 bool has_only_tagged_fields = helper.all_fields_tagged(); |
| 2817 #endif |
2813 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { | 2818 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { |
2814 Object* value = Memory::Object_at(src_slot); | 2819 Object* value = Memory::Object_at(src_slot); |
2815 | 2820 |
2816 Memory::Object_at(dst_slot) = value; | 2821 Memory::Object_at(dst_slot) = value; |
2817 | 2822 |
2818 if (!src->MayContainRawValues()) { | 2823 #if V8_DOUBLE_FIELDS_UNBOXING |
| 2824 if (!may_contain_raw_values && |
| 2825 (has_only_tagged_fields || helper.IsTagged(src_slot - src_addr))) |
| 2826 #else |
| 2827 if (!may_contain_raw_values) |
| 2828 #endif |
| 2829 { |
2819 RecordMigratedSlot(value, dst_slot); | 2830 RecordMigratedSlot(value, dst_slot); |
2820 } | 2831 } |
2821 | 2832 |
2822 src_slot += kPointerSize; | 2833 src_slot += kPointerSize; |
2823 dst_slot += kPointerSize; | 2834 dst_slot += kPointerSize; |
2824 } | 2835 } |
2825 | 2836 |
2826 if (compacting_ && dst->IsJSFunction()) { | 2837 if (compacting_ && dst->IsJSFunction()) { |
2827 Address code_entry_slot = dst_addr + JSFunction::kCodeEntryOffset; | 2838 Address code_entry_slot = dst_addr + JSFunction::kCodeEntryOffset; |
2828 Address code_entry = Memory::Address_at(code_entry_slot); | 2839 Address code_entry = Memory::Address_at(code_entry_slot); |
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4449 SlotsBuffer* buffer = *buffer_address; | 4460 SlotsBuffer* buffer = *buffer_address; |
4450 while (buffer != NULL) { | 4461 while (buffer != NULL) { |
4451 SlotsBuffer* next_buffer = buffer->next(); | 4462 SlotsBuffer* next_buffer = buffer->next(); |
4452 DeallocateBuffer(buffer); | 4463 DeallocateBuffer(buffer); |
4453 buffer = next_buffer; | 4464 buffer = next_buffer; |
4454 } | 4465 } |
4455 *buffer_address = NULL; | 4466 *buffer_address = NULL; |
4456 } | 4467 } |
4457 } | 4468 } |
4458 } // namespace v8::internal | 4469 } // namespace v8::internal |
OLD | NEW |