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/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compilation-cache.h" | 9 #include "src/compilation-cache.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 2812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2823 AllocationSpace dest) { | 2823 AllocationSpace dest) { |
2824 Address dst_addr = dst->address(); | 2824 Address dst_addr = dst->address(); |
2825 Address src_addr = src->address(); | 2825 Address src_addr = src->address(); |
2826 ASSERT(heap()->AllowedToBeMigrated(src, dest)); | 2826 ASSERT(heap()->AllowedToBeMigrated(src, dest)); |
2827 ASSERT(dest != LO_SPACE && size <= Page::kMaxRegularHeapObjectSize); | 2827 ASSERT(dest != LO_SPACE && size <= Page::kMaxRegularHeapObjectSize); |
2828 if (dest == OLD_POINTER_SPACE) { | 2828 if (dest == OLD_POINTER_SPACE) { |
2829 Address src_slot = src_addr; | 2829 Address src_slot = src_addr; |
2830 Address dst_slot = dst_addr; | 2830 Address dst_slot = dst_addr; |
2831 ASSERT(IsAligned(size, kPointerSize)); | 2831 ASSERT(IsAligned(size, kPointerSize)); |
2832 | 2832 |
2833 bool has_only_tagged_fields = !src->IsConstantPoolArray(); | |
2834 #if V8_DOUBLE_FIELDS_UNBOXING | |
2835 InobjectPropertiesHelper helper(src->map()); | |
2836 has_only_tagged_fields = | |
2837 has_only_tagged_fields && helper.all_fields_tagged(); | |
2838 #endif | |
2833 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { | 2839 for (int remaining = size / kPointerSize; remaining > 0; remaining--) { |
2834 Object* value = Memory::Object_at(src_slot); | 2840 Object* value = Memory::Object_at(src_slot); |
2835 | 2841 |
2836 Memory::Object_at(dst_slot) = value; | 2842 Memory::Object_at(dst_slot) = value; |
2837 | 2843 |
2838 // We special case ConstantPoolArrays below since they could contain | 2844 // We special case ConstantPoolArrays below since they could contain |
2839 // integers value entries which look like tagged pointers. | 2845 // integers value entries which look like tagged pointers. |
2840 // TODO(mstarzinger): restructure this code to avoid this special-casing. | 2846 // TODO(mstarzinger): restructure this code to avoid this special-casing. |
2841 if (!src->IsConstantPoolArray()) { | 2847 if (has_only_tagged_fields |
2848 #if V8_DOUBLE_FIELDS_UNBOXING | |
2849 || helper.IsTagged(src_slot - src_addr) | |
Toon Verwaest
2014/07/29 15:02:08
#if V8_DOUBLE_FIELDS_UNBOXING
if (.. || ) {
#else
Igor Sheludko
2014/10/30 14:23:43
Done.
| |
2850 #endif | |
2851 ) { | |
2842 RecordMigratedSlot(value, dst_slot); | 2852 RecordMigratedSlot(value, dst_slot); |
2843 } | 2853 } |
2844 | 2854 |
2845 src_slot += kPointerSize; | 2855 src_slot += kPointerSize; |
2846 dst_slot += kPointerSize; | 2856 dst_slot += kPointerSize; |
2847 } | 2857 } |
2848 | 2858 |
2849 if (compacting_ && dst->IsJSFunction()) { | 2859 if (compacting_ && dst->IsJSFunction()) { |
2850 Address code_entry_slot = dst_addr + JSFunction::kCodeEntryOffset; | 2860 Address code_entry_slot = dst_addr + JSFunction::kCodeEntryOffset; |
2851 Address code_entry = Memory::Address_at(code_entry_slot); | 2861 Address code_entry = Memory::Address_at(code_entry_slot); |
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4501 while (buffer != NULL) { | 4511 while (buffer != NULL) { |
4502 SlotsBuffer* next_buffer = buffer->next(); | 4512 SlotsBuffer* next_buffer = buffer->next(); |
4503 DeallocateBuffer(buffer); | 4513 DeallocateBuffer(buffer); |
4504 buffer = next_buffer; | 4514 buffer = next_buffer; |
4505 } | 4515 } |
4506 *buffer_address = NULL; | 4516 *buffer_address = NULL; |
4507 } | 4517 } |
4508 | 4518 |
4509 | 4519 |
4510 } } // namespace v8::internal | 4520 } } // namespace v8::internal |
OLD | NEW |